diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-03-17 23:06:31 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-03-17 23:06:31 +0000 |
commit | 31feb337a606f4417fbaa4160ed16405de60f609 (patch) | |
tree | 57307caa9455eb4175bf2009a3a7d64e713cef62 /clang/lib/Sema/SemaTemplate.cpp | |
parent | 35e71c771d2ebe4c18f2160bf391fe274e6a800e (diff) | |
download | bcm5719-llvm-31feb337a606f4417fbaa4160ed16405de60f609.tar.gz bcm5719-llvm-31feb337a606f4417fbaa4160ed16405de60f609.zip |
Diagnose tag and class template declarations with qualified
declarator-ids that occur at class scope. Fixes PR8019.
llvm-svn: 153002
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 37c7cefb0da..afa6c0e15b8 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -886,7 +886,9 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK, ContextRAII SavedContext(*this, SemanticContext); if (RebuildTemplateParamsInCurrentInstantiation(TemplateParams)) Invalid = true; - } + } else if (CurContext->isRecord() && TUK != TUK_Friend && + TUK != TUK_Reference) + diagnoseQualifiedDeclInClass(SS, SemanticContext, Name, NameLoc); LookupQualifiedName(Previous, SemanticContext); } else { @@ -1065,7 +1067,7 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK, PrevClassTemplate->setMemberSpecialization(); // Set the access specifier. - if (!Invalid && TUK != TUK_Friend) + if (!Invalid && TUK != TUK_Friend && NewTemplate->getDeclContext()->isRecord()) SetMemberAccessSpecifier(NewTemplate, PrevClassTemplate, AS); // Set the lexical context of these templates |