diff options
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 3 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-complete.cpp | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 9b8031b7fdf..a18701e61d9 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -582,6 +582,9 @@ public: if (!DC) return QualType(); + if (SemaRef.RequireCompleteDeclContext(SS, DC)) + return QualType(); + TagDecl *Tag = 0; SemaRef.LookupQualifiedName(Result, DC); switch (Result.getResultKind()) { diff --git a/clang/test/SemaTemplate/instantiate-complete.cpp b/clang/test/SemaTemplate/instantiate-complete.cpp index a2cb0491732..c13930d108c 100644 --- a/clang/test/SemaTemplate/instantiate-complete.cpp +++ b/clang/test/SemaTemplate/instantiate-complete.cpp @@ -119,3 +119,12 @@ namespace PR7080 { bool x = X<int, rv<int>&>::value; } + +namespace pr7199 { + template <class T> class A; // expected-note {{template is declared here}} + template <class T> class B { + class A<T>::C field; // expected-error {{implicit instantiation of undefined template 'pr7199::A<int>'}} + }; + + template class B<int>; // expected-note {{in instantiation}} +} |