diff options
author | John McCall <rjmccall@apple.com> | 2010-05-27 06:40:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-05-27 06:40:31 +0000 |
commit | 5613876991c80a684595fe8de1f039296a0657ff (patch) | |
tree | cf22003ab9e073ec30bfb11203685d0707d68f34 | |
parent | 1ca3bd8e72b0839f75e63b9cbde34e905c456bfa (diff) |
Require a complete type when performing the qualified lookup during
instantiation of a dependent elaborated type specifier. Fixes PR 7199.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104822 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/TreeTransform.h | 3 | ||||
-rw-r--r-- | test/SemaTemplate/instantiate-complete.cpp | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 9b8031b7fd..a18701e61d 100644 --- a/lib/Sema/TreeTransform.h +++ b/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/test/SemaTemplate/instantiate-complete.cpp b/test/SemaTemplate/instantiate-complete.cpp index a2cb049173..c13930d108 100644 --- a/test/SemaTemplate/instantiate-complete.cpp +++ b/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}} +} |