summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-05-27 06:40:31 +0000
committerJohn McCall <rjmccall@apple.com>2010-05-27 06:40:31 +0000
commitbf8c519a0db184c566120f415492afbb5215bb35 (patch)
tree2361844d9d548de0bb009b7d26e24c37cc794864
parentf9d147bddb3b6e9cecb5178e2c3f3a09c40f7c2d (diff)
downloadbcm5719-llvm-bf8c519a0db184c566120f415492afbb5215bb35.tar.gz
bcm5719-llvm-bf8c519a0db184c566120f415492afbb5215bb35.zip
Require a complete type when performing the qualified lookup during
instantiation of a dependent elaborated type specifier. Fixes PR 7199. llvm-svn: 104822
-rw-r--r--clang/lib/Sema/TreeTransform.h3
-rw-r--r--clang/test/SemaTemplate/instantiate-complete.cpp9
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}}
+}
OpenPOWER on IntegriCloud