summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-30 21:46:38 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-30 21:46:38 +0000
commitc0c8300329718b45df259c49310d3c2b377a6e0f (patch)
tree4a6240540711d7d6fa64d60b2e8ca26248505e3a /test/SemaTemplate/instantiate-non-type-template-parameter.cpp
parent2888b65aae768f54062505330df7be230a0510c7 (diff)
downloadclang-c0c8300329718b45df259c49310d3c2b377a6e0f.tar.gz
clang-c0c8300329718b45df259c49310d3c2b377a6e0f.tar.bz2
clang-c0c8300329718b45df259c49310d3c2b377a6e0f.tar.xz
After substituting a template argument for a non-type template
parameter with pointer-to-member type, we may have to perform a qualification conversion, since the pointee type of the parameter might be more qualified than the pointee type of the argument we form from the declaration. Fixes PR6986. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-non-type-template-parameter.cpp')
-rw-r--r--test/SemaTemplate/instantiate-non-type-template-parameter.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-non-type-template-parameter.cpp b/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
index 414e62b13a..cbadcde2c1 100644
--- a/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
+++ b/test/SemaTemplate/instantiate-non-type-template-parameter.cpp
@@ -9,6 +9,28 @@ public:
}
};
-int main(int argc, char *argv[]) {
+void test_stringswitch(int argc, char *argv[]) {
(void)StringSwitch<int>();
}
+
+namespace PR6986 {
+ template<class Class,typename Type,Type Class::*>
+ struct non_const_member_base
+ {
+ };
+
+ template<class Class,typename Type,Type Class::*PtrToMember>
+ struct member: non_const_member_base<Class,Type,PtrToMember>
+ {
+ };
+
+ struct test_class
+ {
+ int int_member;
+ };
+ typedef member< test_class,const int,&test_class::int_member > ckey_m;
+ void test()
+ {
+ ckey_m m;
+ }
+}