[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-17 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik approved this pull request. https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/9] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -167,9 +167,11 @@ Parser::DeclGroupPtrTy Parser::ParseTemplateDeclarationOrSpecialization( LastParamListWasEmpty); // Parse the actual template declaration. - if (Tok.is(tok::kw_concept)) -return Actions.ConvertDeclToDeclGroup( -

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/8] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Shafik Yaghmour via cfe-commits
@@ -167,9 +167,11 @@ Parser::DeclGroupPtrTy Parser::ParseTemplateDeclarationOrSpecialization( LastParamListWasEmpty); // Parse the actual template declaration. - if (Tok.is(tok::kw_concept)) -return Actions.ConvertDeclToDeclGroup( -

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. LGTM, thanks! https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C Endilll wrote: (MSVC spelling was removed.)

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -8092,6 +8092,18 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc); } +void Sema::CheckConstrainedAuto(TypeSourceInfo *TS) { + if (getLangOpts().CPlusPlus20) {

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -8092,6 +8092,18 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc); } +void Sema::CheckConstrainedAuto(TypeSourceInfo *TS) { + if (getLangOpts().CPlusPlus20) { +if (const AutoType

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/7] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/6] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -316,7 +318,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo , const IdentifierInfo *Id = Result.Identifier; SourceLocation IdLoc = Result.getBeginLoc(); - DiagnoseAndSkipCXX11Attributes(); + ParsedAttributes Attrs(AttrFactory); +

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -8092,6 +8092,18 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc); } +void Sema::CheckConstrainedAuto(TypeSourceInfo *TS) { + if (getLangOpts().CPlusPlus20) {

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -8092,6 +8092,18 @@ void Sema::checkCall(NamedDecl *FDecl, const FunctionProtoType *Proto, diagnoseArgDependentDiagnoseIfAttrs(FD, ThisArg, Args, Loc); } +void Sema::CheckConstrainedAuto(TypeSourceInfo *TS) { + if (getLangOpts().CPlusPlus20) { +if (const AutoType

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -316,7 +318,8 @@ Parser::ParseConceptDefinition(const ParsedTemplateInfo , const IdentifierInfo *Id = Result.Identifier; SourceLocation IdLoc = Result.getBeginLoc(); - DiagnoseAndSkipCXX11Attributes(); + ParsedAttributes Attrs(AttrFactory); +

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C Endilll wrote: I added support for GNU and MSVC spellings.

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/5] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/4] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C Endilll wrote: Non-standard spellings of this attribute are out of scope of the Core

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
@@ -45,6 +45,38 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #cwg2428-C + +template +[[deprecated]] concept C2 = true; +// expected-error@-1 {{expected unqualified-id}} +

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/3] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C cor3ntin wrote: As it turns out, GCC does support GNU-style attributes

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
https://github.com/cor3ntin edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C cor3ntin wrote: `concept C __attribute__((deprecated)) = true; ` should be ill-formed.

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-16 Thread via cfe-commits
@@ -45,6 +45,38 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #cwg2428-C + +template +[[deprecated]] concept C2 = true; +// expected-error@-1 {{expected unqualified-id}} +

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C Endilll wrote: I added test with alternative attribute placing. > It would also be good

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -10698,7 +10698,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/1815.html;>1815 CD4 Lifetime extension in aggregate initialization -Clang 19 +Yes Endilll wrote: I updated the branch from `main`, now

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/92295 >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Wed, 15 May 2024 20:20:43 +0300 Subject: [PATCH 1/2] [clang] Implement CWG2428 "Deprecating a concept" ---

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Aaron Ballman via cfe-commits
@@ -10698,7 +10698,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/1815.html;>1815 CD4 Lifetime extension in aggregate initialization -Clang 19 +Yes AaronBallman wrote: It's usually better to apply the

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
@@ -10698,7 +10698,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/1815.html;>1815 CD4 Lifetime extension in aggregate initialization -Clang 19 +Yes Endilll wrote: This particular one is an unfortunate

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Aaron Ballman via cfe-commits
@@ -45,6 +45,34 @@ void fallthrough(int n) { #endif } +namespace cwg2428 { // cwg2428: 19 +#if __cplusplus >= 202002L +template +concept C [[deprecated]] = true; // #C AaronBallman wrote: I'd like an additional test for rejecting: ``` template

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Aaron Ballman via cfe-commits
@@ -10698,7 +10698,7 @@ C++ defect report implementation status https://cplusplus.github.io/CWG/issues/1815.html;>1815 CD4 Lifetime extension in aggregate initialization -Clang 19 +Yes AaronBallman wrote: Unrelated changes snuck in.

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Please be sure to add a release note about implementing the DR. https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/92295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) Changes This patch allows attributes to be attached to C++20 concepts, implementing [CWG2428](https://cplusplus.github.io/CWG/issues/2428.html). --- Full diff:

[clang] [clang] Implement CWG2428 "Deprecating a concept" (PR #92295)

2024-05-15 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/92295 This patch allows attributes to be attached to C++20 concepts, implementing [CWG2428](https://cplusplus.github.io/CWG/issues/2428.html). >From a0d5a234431f3db2f0283ffa0909bf8c254aa611 Mon Sep 17 00:00:00 2001