aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-10 06:41:28 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-10 06:41:28 +0000
commitd0c09393d0b2f59dc14ab31f63bd5348c8f4ffb7 (patch)
treebd4a1f03abcd652e164afb85a897b834fa5755d6 /clang/test
parentbfe648303aba4b80724098ece3bc02c6181af119 (diff)
downloadllvm-d0c09393d0b2f59dc14ab31f63bd5348c8f4ffb7.zip
llvm-d0c09393d0b2f59dc14ab31f63bd5348c8f4ffb7.tar.gz
llvm-d0c09393d0b2f59dc14ab31f63bd5348c8f4ffb7.tar.bz2
Merging r196852:
------------------------------------------------------------------------ r196852 | majnemer | 2013-12-09 16:40:58 -0800 (Mon, 09 Dec 2013) | 10 lines Sema: Enforce C++11 pointer-to-member template arguments should rules The standard is pretty clear on what it allows inside of template arguments for non-type template parameters of pointer-to-member. They must be of the form &qualified-id and cannot come from sources like constexpr VarDecls or things of that nature. This fixes PR18192. ------------------------------------------------------------------------ llvm-svn: 196885
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/instantiate-member-pointers.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-pointers.cpp b/clang/test/SemaTemplate/instantiate-member-pointers.cpp
index 0db90e3..4757870 100644
--- a/clang/test/SemaTemplate/instantiate-member-pointers.cpp
+++ b/clang/test/SemaTemplate/instantiate-member-pointers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct Y {
int x;
};
@@ -65,3 +65,10 @@ namespace ValueDepMemberPointer {
}
S<int> s;
}
+
+namespace PR18192 {
+ struct A { struct { int n; }; };
+ template<int A::*> struct X {};
+ constexpr int A::*p = &A::n;
+ X<p> x; // expected-error{{not a pointer to member constant}}
+}