aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorVassil Vassilev <v.g.vassilev@gmail.com>2023-05-08 10:48:03 +0000
committerVassil Vassilev <v.g.vassilev@gmail.com>2023-05-08 17:54:56 +0000
commit2c4620c1dadc032f968ce0aa835a441f268a8cdb (patch)
tree1744f3e07224de93975100b80211b3c362934328 /clang/lib/Parse/ParseTentative.cpp
parent25cc5a71b3a2f197fd3c31eeba1eeb1711b93de2 (diff)
downloadllvm-2c4620c1dadc032f968ce0aa835a441f268a8cdb.zip
llvm-2c4620c1dadc032f968ce0aa835a441f268a8cdb.tar.gz
llvm-2c4620c1dadc032f968ce0aa835a441f268a8cdb.tar.bz2
[clang-repl] Consider the scope spec in template lookups for deduction guides.
isDeductionGuideName looks up the underlying template and if the template name is qualified we miss that qualification resulting in an error. This issue resurfaced in clang-repl where we call isDeductionGuideName more often to distinguish between if we had a statement or declaration. This patch passes the CXXScopeSpec information down to LookupTemplateName to make the lookup more precise. Differential revision: https://reviews.llvm.org/D147319
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r--clang/lib/Parse/ParseTentative.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 934087e..02aa59e 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -74,9 +74,8 @@ bool Parser::isCXXDeclarationStatement(
switch (Tok.getKind()) {
case tok::identifier: {
IdentifierInfo *II = Tok.getIdentifierInfo();
- bool isDeductionGuide =
- Actions.isDeductionGuideName(getCurScope(), *II, Tok.getLocation(),
- /*Template=*/nullptr);
+ bool isDeductionGuide = Actions.isDeductionGuideName(
+ getCurScope(), *II, Tok.getLocation(), SS, /*Template=*/nullptr);
if (Actions.isCurrentClassName(*II, getCurScope(), &SS) ||
isDeductionGuide) {
if (isConstructorDeclarator(/*Unqualified=*/SS.isEmpty(),