diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-09 22:14:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-09 22:14:25 +0000 |
commit | 7bf80c8d8f328456a72c31e07837096023b6659b (patch) | |
tree | 4d6f68ad6a66ee5321e16f640a5cdd1fd7571dfc /lib/Parse | |
parent | 05157f019a673fad31e11d9ceaaea1b78ef3de90 (diff) |
Diagnose attempts to explicitly instantiate a template at class scope. Previously Clang would simply ignore the 'template' keyword in this case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index d558909603..8d89f40937 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -2459,9 +2459,10 @@ Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, if (Tok.is(tok::kw_template)) { assert(!TemplateInfo.TemplateParams && "Nested template improperly parsed?"); + ObjCDeclContextSwitch ObjCDC(*this); SourceLocation DeclEnd; return DeclGroupPtrTy::make( - DeclGroupRef(ParseDeclarationStartingWithTemplate( + DeclGroupRef(ParseTemplateDeclarationOrSpecialization( Declarator::MemberContext, DeclEnd, AS, AccessAttrs))); } |