diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-27 02:00:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-04-27 02:00:13 +0000 |
commit | c08b693e309baa80f0a3dd7794af130c3393c777 (patch) | |
tree | 30986154bf0d7997794a5746ca6270df4d53f40c /clang/lib/Parse/ParseDecl.cpp | |
parent | 93979f67f8cc49f596ae34c45699371bd3cda785 (diff) | |
download | llvm-c08b693e309baa80f0a3dd7794af130c3393c777.zip llvm-c08b693e309baa80f0a3dd7794af130c3393c777.tar.gz llvm-c08b693e309baa80f0a3dd7794af130c3393c777.tar.bz2 |
Parse A::template B as an identifier rather than as a template-id with no
template arguments.
This fixes some cases where we'd incorrectly accept "A::template B" when B is a
kind of template that requires template arguments (in particular, a variable
template or a concept).
llvm-svn: 331013
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 3d3abe3..fc0ca61 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5600,12 +5600,11 @@ void Parser::ParseDirectDeclarator(Declarator &D) { D.getContext() == DeclaratorContext::MemberContext); } - SourceLocation TemplateKWLoc; bool HadScope = D.getCXXScopeSpec().isValid(); if (ParseUnqualifiedId(D.getCXXScopeSpec(), /*EnteringContext=*/true, /*AllowDestructorName=*/true, AllowConstructorName, - AllowDeductionGuide, nullptr, TemplateKWLoc, + AllowDeductionGuide, nullptr, nullptr, D.getName()) || // Once we're past the identifier, if the scope was bad, mark the // whole declarator bad. |