[clang] [clang] Fix crash in concept deprecation (PR #98622)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 18 08:49:17 PDT 2024
================
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) {
CheckExtraCXXDefaultArguments(D);
}
- if (const AutoType *AutoT = T->getAs<AutoType>())
- CheckConstrainedAuto(
- AutoT,
- TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());
-
+ if (const AutoType *AutoT = T->getAs<AutoType>()) {
+ AutoTypeLoc Loc = TInfo->getTypeLoc().getContainedAutoTypeLoc();
+ CheckConstrainedAuto(AutoT,
+ Loc ? Loc.getConceptNameLoc() : SourceLocation());
+ }
----------------
Endilll wrote:
Test with constrained auto in trailing return type doesn't pass otherwise:
https://github.com/llvm/llvm-project/blob/2bdcfbe62cb9a08df4b58a17d44be0a3082df053/clang/test/CXX/drs/cwg24xx.cpp#L78-L81
https://github.com/llvm/llvm-project/pull/98622
More information about the cfe-commits
mailing list