diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-07 17:33:42 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-07 17:33:42 +0000 |
commit | efaa93aaa2653f4eb40e6a22e504a448da94aaf8 (patch) | |
tree | 5361c9696519f5b4df75e82d1673469266e7f674 /test/SemaTemplate/instantiate-member-class.cpp | |
parent | 90f93d4c6e257903c951c5ff22cf3cf3806fca63 (diff) |
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/instantiate-member-class.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-member-class.cpp | 22 |
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}} + } +} |