Author: rjmccall Date: Thu May 27 01:40:31 2010 New Revision: 104822 URL: http://llvm.org/viewvc/llvm-project?rev=104822&view=rev Log: Require a complete type when performing the qualified lookup during instantiation of a dependent elaborated type specifier. Fixes PR 7199.
Modified: cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/test/SemaTemplate/instantiate-complete.cpp Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=104822&r1=104821&r2=104822&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu May 27 01:40:31 2010 @@ -582,6 +582,9 @@ if (!DC) return QualType(); + if (SemaRef.RequireCompleteDeclContext(SS, DC)) + return QualType(); + TagDecl *Tag = 0; SemaRef.LookupQualifiedName(Result, DC); switch (Result.getResultKind()) { Modified: cfe/trunk/test/SemaTemplate/instantiate-complete.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-complete.cpp?rev=104822&r1=104821&r2=104822&view=diff ============================================================================== --- cfe/trunk/test/SemaTemplate/instantiate-complete.cpp (original) +++ cfe/trunk/test/SemaTemplate/instantiate-complete.cpp Thu May 27 01:40:31 2010 @@ -119,3 +119,12 @@ 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}} +} _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits