================
@@ -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:

Regarding the error recovery issue, in `SemaOverload.cpp`:

In `FixOverloadedFunctionReference`, for both `UnresolvedLookupExpr` and 
`UnresolvedMemberExpr`, we must avoid building a `DeclRefExpr` which has a 
function type returning undeduced auto.

Presently this should only happen for calls to deleted functions returning a 
deduced type, so should only happen when it's called from 
`FinishOverloadedCallExpr`, in the `OR_Deleted` case.

You can replace just the `auto` in the return type with `int`, keeping pointers 
and references in case of `auto *` or `auto &`. That can be done using 
`Sema::SubstAutoType`.

Eventually when we implement some kind of `ErrorTy`, for improving error 
recovery, we can change all such uses of 'int', using that instead.

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