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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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

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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

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

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed 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

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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited 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

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

2024-07-18 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: LGTM, Thanks! 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

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

2024-07-18 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov approved this pull request. 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

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

2024-07-18 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
@@ -36,4 +36,11 @@ template // expected-warning@-1 {{'C' is deprecated}} // expected-note@#C {{'C' has been explicitly marked deprecated here}} void f(); + +template +auto b() = delete; // #b + +decltype(b<0>()) x; +// expected-error@-1 {{call to deleted function 'b'}} +//

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

2024-07-18 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/98622 >From 5310764fb4044bcd4229434e80b64870c4b4ee8c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Jul 2024 15:12:37 +0300 Subject: [PATCH 1/4] [clang] Fix crash in concept deprecation Apparently we

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

2024-07-18 Thread via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-18 Thread via cfe-commits
@@ -36,4 +36,11 @@ template // expected-warning@-1 {{'C' is deprecated}} // expected-note@#C {{'C' has been explicitly marked deprecated here}} void f(); + +template +auto b() = delete; // #b + +decltype(b<0>()) x; +// expected-error@-1 {{call to deleted function 'b'}} +//

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

2024-07-18 Thread via cfe-commits
https://github.com/cor3ntin edited 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

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

2024-07-18 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. I think this makes sense but please give @mizvekov the day to review before landing Thank you both for working on this https://github.com/llvm/llvm-project/pull/98622 ___ cfe-commits mailing li

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

2024-07-17 Thread Vlad Serebrennikov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

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

2024-07-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/98622 >From 5310764fb4044bcd4229434e80b64870c4b4ee8c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Jul 2024 15:12:37 +0300 Subject: [PATCH 1/3] [clang] Fix crash in concept deprecation Apparently we

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

2024-07-17 Thread Vlad Serebrennikov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

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

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -6308,11 +6308,11 @@ TypeResult Sema::ActOnTypeName(Declarator &D) { CheckExtraCXXDefaultArguments(D); } - if (const AutoType *AutoT = T->getAs()) -CheckConstrainedAuto( -AutoT, -TInfo->getTypeLoc().getContainedAutoTypeLoc().getConceptNameLoc());

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

2024-07-17 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-17 Thread Vlad Serebrennikov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/98622 >From 5310764fb4044bcd4229434e80b64870c4b4ee8c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Jul 2024 15:12:37 +0300 Subject: [PATCH 1/2] [clang] Fix crash in concept deprecation Apparently we

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

2024-07-15 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-15 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-13 Thread Vlad Serebrennikov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-12 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov requested changes to this pull request. See previous comments, I think this is primarily an error recovery issue on the decltype, we shouldn't let it escape an undeduced auto, as that would confuse further analysis. https://github.com/llvm/llvm-project/pull/98622 __

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

2024-07-12 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-12 Thread Matheus Izvekov via cfe-commits
@@ -7416,10 +7416,11 @@ NamedDecl *Sema::ActOnVariableDeclarator( tryToFixVariablyModifiedVarType(TInfo, R, D.getIdentifierLoc(), /*DiagID=*/0); - if (const AutoType *AutoT = R->getAs()) -CheckConstrainedAuto( -AutoT, -

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

2024-07-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > Do you have an idea as to why the type location is invalid in the first > > place? > > Looking at the new test, my guess is that `auto` remains undeduced, so it has > nowhere to point out to. Even when it's undeduced, we should still have a source location for it becau

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

2024-07-12 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM but I agree with Aaron that tracking exactly where we create an invalid Loc would be interesting. https://github.com/llvm/llvm-project/pull/98622 ___ cfe-commits mailing list cfe-commits@lis

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

2024-07-12 Thread Vlad Serebrennikov via cfe-commits
Endilll wrote: > Do you have an idea as to why the type location is invalid in the first place? Looking at the new test, my guess is that `auto` remains undeduced, so it has nowhere to point out to. https://github.com/llvm/llvm-project/pull/98622 ___

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

2024-07-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Do you have an idea as to why the type location is invalid in the first place? https://github.com/llvm/llvm-project/pull/98622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

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

2024-07-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes Apparently we can't assume that `AutoTypeLoc` from `AutoType` is always valid. Fixes #98164 --- Full diff: https://github.com/llvm/llvm-project/pull/98622.diff 3 Files Affected: - (modified) clang/l

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

2024-07-12 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/98622 Apparently we can't assume that `AutoTypeLoc` from `AutoType` is always valid. Fixes #98164 >From 5310764fb4044bcd4229434e80b64870c4b4ee8c Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Fri, 12 Jul 202