[clang] [clang] Fix crash in concept deprecation (PR #98622)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 18 01:00:40 PDT 2024


================
@@ -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();
----------------
cor3ntin wrote:

> If I correctly understand description of TypeLoc correctly, TypeLoc is trailing data of Type SourceInfo. Is that correct?

Yes, the fact we have both and use both, inconsistently, which is not an ideal situation

> Calling DiagnoseUseOfDecl there seems too early. It triggers on declaration of deprecated concept.

This is weird but I'm not sure we need further changes here

https://github.com/llvm/llvm-project/pull/98622


More information about the cfe-commits mailing list