summaryrefslogtreecommitdiff
path: root/test/SemaTemplate
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-07 17:33:42 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-07 17:33:42 +0000
commitefaa93aaa2653f4eb40e6a22e504a448da94aaf8 (patch)
tree5361c9696519f5b4df75e82d1673469266e7f674 /test/SemaTemplate
parent90f93d4c6e257903c951c5ff22cf3cf3806fca63 (diff)
downloadclang-efaa93aaa2653f4eb40e6a22e504a448da94aaf8.tar.gz
Tighten up the conditions under which we consider ourselves to be
entering the context of a nested-name-specifier. Fixes <rdar://problem/10397846>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143967 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate')
-rw-r--r--test/SemaTemplate/instantiate-member-class.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-member-class.cpp b/test/SemaTemplate/instantiate-member-class.cpp
index c67eb4022a..bb6427670c 100644
--- a/test/SemaTemplate/instantiate-member-class.cpp
+++ b/test/SemaTemplate/instantiate-member-class.cpp
@@ -118,3 +118,25 @@ namespace AliasTagDef {
int m = F<int>::S().g();
int n = F<int>::U().g();
}
+
+namespace rdar10397846 {
+ template<int I> struct A
+ {
+ struct B
+ {
+ struct C { C() { int *ptr = I; } }; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}}
+ };
+ };
+
+ template<int N> void foo()
+ {
+ class A<N>::B::C X; // expected-note{{in instantiation of member function}}
+ int A<N+1>::B::C::*member = 0;
+ }
+
+ void bar()
+ {
+ foo<0>();
+ foo<1>(); // expected-note{{in instantiation of function template}}
+ }
+}