================
@@ -3860,18 +3862,44 @@ void Parser::ParseDeclarationSpecifiers(
DS.isFriendSpecified()))
goto DoneWithDeclSpec;
+ // If 'auto' is set and we're in a template parameter context, the
+ // identifier is always the parameter name, not a type specifier, so skip
+ // type name lookup to avoid false ambiguity errors.
+ if (DS.getTypeSpecType() == DeclSpec::TST_auto &&
+ DSContext == DeclSpecContext::DSC_template_param) {
+ goto DoneWithDeclSpec;
+ }
+
+ // If 'auto' is set and the next token indicates this identifier is the
+ // declarator-id, stop parsing declaration specifiers before doing type
+ // lookup. Looking up the declarator-id can produce bogus ambiguity
errors
+ // when a variable name matches a type brought in by a using-directive.
+ if (DS.getTypeSpecType() == DeclSpec::TST_auto) {
+ Token Next = NextToken();
+ if (Next.isOneOf(tok::equal, tok::l_paren, tok::l_square, tok::amp,
----------------
ronlieb wrote:
This is breaking our windows hip-test builds (downstream) ETA for fix ?
https://github.com/llvm/llvm-project/pull/208552
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits