aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-03-16 19:47:06 +0000
committerBill Wendling <isanbard@gmail.com>2011-03-16 19:47:06 +0000
commit8b05d478a8769b3b47ffe06590147cef1caa2a3f (patch)
treea2da833b9c61a194ef30bcc83caae56279cb53dc
parent04fa52db15354f38310d8e3eca65c49ab77cb969 (diff)
downloadllvm-8b05d478a8769b3b47ffe06590147cef1caa2a3f.zip
llvm-8b05d478a8769b3b47ffe06590147cef1caa2a3f.tar.gz
llvm-8b05d478a8769b3b47ffe06590147cef1caa2a3f.tar.bz2
--- Merging r127512 into '.':
U test/SemaTemplate/nested-name-spec-template.cpp U lib/Sema/SemaTemplate.cpp llvm-svn: 127750
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp3
-rw-r--r--clang/test/SemaTemplate/nested-name-spec-template.cpp13
2 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index e60a1c4..f5be397 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -2028,7 +2028,8 @@ TemplateNameKind Sema::ActOnDependentTemplateName(Scope *S,
MemberOfUnknownSpecialization);
if (TNK == TNK_Non_template && LookupCtx->isDependentContext() &&
isa<CXXRecordDecl>(LookupCtx) &&
- cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()) {
+ (!cast<CXXRecordDecl>(LookupCtx)->hasDefinition() ||
+ cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases())) {
// This is a dependent template. Handle it below.
} else if (TNK == TNK_Non_template) {
Diag(Name.getSourceRange().getBegin(),
diff --git a/clang/test/SemaTemplate/nested-name-spec-template.cpp b/clang/test/SemaTemplate/nested-name-spec-template.cpp
index 7730ee3..635687d 100644
--- a/clang/test/SemaTemplate/nested-name-spec-template.cpp
+++ b/clang/test/SemaTemplate/nested-name-spec-template.cpp
@@ -127,3 +127,16 @@ namespace PR9226 {
Y<X, int> yxi; // expected-note{{in instantiation of template class 'PR9226::Y<PR9226::X, int>' requested here}}
}
+
+namespace PR9449 {
+ template <typename T>
+ struct s; // expected-note{{template is declared here}}
+
+ template <typename T>
+ void f() {
+ int s<T>::template n<T>::* f; // expected-error{{implicit instantiation of undefined template 'PR9449::s<int>'}} \
+ // expected-error{{following the 'template' keyword}}
+ }
+
+ template void f<int>(); // expected-note{{in instantiation of}}
+}