================
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator(
     tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(),
                                     /*DiagID=*/0);
 
-  if (const AutoType *AutoT = R->getAs<AutoType>())
-    CheckConstrainedAuto(
-        AutoT,
-        TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());
+  if (const AutoType *AutoT = R->getAs<AutoType>()) {
+    AutoTypeLoc Loc = TInfo->getTypeLoc().getContainedAutoTypeLoc();
----------------
mizvekov wrote:

Oh, looking at the reproducer, I see the problem:

Our variable is getting the type of an undeduced AutoType through that decltype 
calling a deleted function with auto type.

This is confusing our semantic analysis for the variable, as now we think the 
variable was declared as auto, as getAs will look through all sugar nodes, 
'decltype' included.

Since `getContainedAutoTypeLoc()` doesn't look through decltype, you get a 
crash.

But we shouldn't be getting an 'auto' here in the first place.

The correct fix would be to make that decltype have some error type, for error 
recovery purposes.

Since we don't implement a generic unknown error type, 'int' would still be 
better.

https://github.com/llvm/llvm-project/pull/98622
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to