From 2c4620c1dadc032f968ce0aa835a441f268a8cdb Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 8 May 2023 10:48:03 +0000 Subject: [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 --- clang/lib/Parse/ParseDecl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Parse/ParseDecl.cpp') diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index e28d609..2bbe2ba 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -3696,11 +3696,12 @@ void Parser::ParseDeclarationSpecifiers( // Likewise, if this is a context where the identifier could be a template // name, check whether this is a deduction guide declaration. + CXXScopeSpec SS; if (getLangOpts().CPlusPlus17 && (DSContext == DeclSpecContext::DSC_class || DSContext == DeclSpecContext::DSC_top_level) && Actions.isDeductionGuideName(getCurScope(), *Tok.getIdentifierInfo(), - Tok.getLocation()) && + Tok.getLocation(), SS) && isConstructorDeclarator(/*Unqualified*/ true, /*DeductionGuide*/ true)) goto DoneWithDeclSpec; -- cgit v1.1