aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-member-pointers.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-11-12 17:40:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-11-12 17:40:13 +0000
commit231edff7907cf151f1d046f287d3ee4ad90037cc (patch)
tree3e3254a2a414b0969e22c1e9c602ac1687d70d62 /test/SemaTemplate/instantiate-member-pointers.cpp
parent2811ccf48d6d898c42cc4cfad37abedb36236d20 (diff)
When instantiating a reference to a non-type template parameter of pointer to
member type (e.g., T Class::*Member), build a pointer-to-member constant expression. Previously, we we just building a simple declaration reference expression, which meant that the expression was not treated as a pointer to member. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-member-pointers.cpp')
-rw-r--r--test/SemaTemplate/instantiate-member-pointers.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-member-pointers.cpp b/test/SemaTemplate/instantiate-member-pointers.cpp
index b3ddb3fafa..63e6dac096 100644
--- a/test/SemaTemplate/instantiate-member-pointers.cpp
+++ b/test/SemaTemplate/instantiate-member-pointers.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
struct Y {
int x;
};
@@ -25,3 +24,12 @@ struct X2 {
template struct X2<int, Y>;
template struct X2<int&, Y>; // expected-note{{instantiation}}
template struct X2<const void, Y>; // expected-note{{instantiation}}
+
+template<typename T, typename Class, T Class::*Ptr>
+struct X3 {
+ X3<T, Class, Ptr> &operator=(const T& value) {
+ return *this;
+ }
+};
+
+X3<int, Y, &Y::x> x3;