[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,78 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Richard Smith via cfe-commits
@@ -2352,26 +2352,78 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > We could maybe presume glibc on ELF targets > > Isn't that part of the triple? `aarch64-linux-gnu` gnu -> glibc (as opposed > to `aarch64-linux-musl` -> musl, or `aarch64-linux-android` -> bionic) Oh -- I wasn't aware we tracked that in the triple, that's awesome! I'll

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: > We could maybe presume glibc on ELF targets Isn't that part of the triple? `aarch64-linux-gnu` gnu -> glibc (as opposed to `aarch64-linux-musl` -> musl, or `aarch64-linux-android` -> bionic) https://github.com/llvm/llvm-project/pull/67360 __

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Alexander Richardson via cfe-commits
arichardson wrote: > > With regard to arguments: I know that the [FreeBSD runtime > > linker](https://github.com/freebsd/freebsd-src/blob/d06328c37bbcf3d3d3c7601372d29237996a6f6a/libexec/rtld-elf/aarch64/rtld_machdep.h#L59) > > (and according to https://stackoverflow.com/a/46331112 also glibc)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I think we're going to be stuck with 'warning-as-default-error' here, and let > compiler-rt and tests/etc opt-out. I realize that makes the error not as > effective, but it is really the one 'good' way for the 'implementation' in > this case to handle itself. Yeah, havin

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-27 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > With regard to arguments: I know that the [FreeBSD runtime > linker](https://github.com/freebsd/freebsd-src/blob/d06328c37bbcf3d3d3c7601372d29237996a6f6a/libexec/rtld-elf/aarch64/rtld_machdep.h#L59) > (and according to https://stackoverflow.com/a/46331112 also glibc) passe

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Alexander Richardson via cfe-commits
arichardson wrote: With regard to arguments: I know that the [FreeBSD runtime linker](https://github.com/freebsd/freebsd-src/blob/d06328c37bbcf3d3d3c7601372d29237996a6f6a/libexec/rtld-elf/aarch64/rtld_machdep.h#L59) (and according to https://stackoverflow.com/a/46331112 also glibc) passes argc

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
nickdesaulniers wrote: ah, yeah I was curious about what precisely `reserved for the implementation` meant. System libraries? That means they should be able to opt out via `-Wno-whatever`. For anything thats */test/*, I assume they can be adjusted to just not use a reserved priority? https:/

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
@@ -3176,6 +3178,11 @@ def err_alignas_underaligned : Error< "requested alignment is less than minimum alignment of %1 for type %0">; def warn_aligned_attr_underaligned : Warning, InGroup; +def err_ctor_dtor_attr_on_non_void_func : Error< + "%0 attribute can only be applie

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
erichkeane wrote: I think we're going to be stuck with 'warning-as-default-error' here, and let compiler-rt and tests/etc opt-out. I realize that makes the error not as effective, but it is really the one 'good' way for the 'implementation' in this case to handle itself. https://github.com/l

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Fangrui Song via cfe-commits
MaskRay wrote: I haven't looked closely, but the patch made constructor with priority 0~100 an error? ``` error: 'destructor' attribute requires integer constant between 101 and 65535 inclusive ``` I think we should just use a warning to discourage user programs to use 0~100. Compiler runtime

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: There are six failures I've found, three in tests and three in source: Source: * https://github.com/llvm/llvm-project/blob/ebfea261e6a28e0ba33f437476202a25212b2d34/compiler-rt/lib/fuzzer/afl/afl_driver.cpp#L112 * https://github.com/llvm/llvm-project/blob/ebfea261e6a28e0ba33

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I've reverted in 50abfc4298980fc219c7d70ca2567c61e856b614 due to bots going red, I think we may need to make priority-related issues a warning rather than an error. https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits m

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread via cfe-commits
dyung wrote: Also caused some test failures (this bot uses GCC to build which is why it didn't hit the compilation failure): https://lab.llvm.org/buildbot/#/builders/247/builds/9484 https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mail

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Vitaly Buka via cfe-commits
vitalybuka wrote: https://lab.llvm.org/buildbot/#/builders/70/builds/44561/steps/7/logs/stdio https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -3176,6 +3178,11 @@ def err_alignas_underaligned : Error< "requested alignment is less than minimum alignment of %1 for type %0">; def warn_aligned_attr_underaligned : Warning, InGroup; +def err_ctor_dtor_attr_on_non_void_func : Error< + "%0 attribute can only be applie

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
@@ -3176,6 +3178,11 @@ def err_alignas_underaligned : Error< "requested alignment is less than minimum alignment of %1 for type %0">; def warn_aligned_attr_underaligned : Warning, InGroup; +def err_ctor_dtor_attr_on_non_void_func : Error< + "%0 attribute can only be applie

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers approved this pull request. https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Nick Desaulniers via cfe-commits
https://github.com/nickdesaulniers edited https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67360 >From 6e9bcfa7fc5eb3da4592909b9e199215064df700 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 25 Sep 2023 15:03:56 -0400 Subject: [PATCH 1/5] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. Do we have a codegen test for the constexpr case? I'm concerned that we don't 'force' emission of these functions . Either way, I think this set of diagnostic changes makes sense. https://github.com/llvm/llvm-project/pull/67360 ___

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67360 >From 6e9bcfa7fc5eb3da4592909b9e199215064df700 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 25 Sep 2023 15:03:56 -0400 Subject: [PATCH 1/4] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67360 >From 6e9bcfa7fc5eb3da4592909b9e199215064df700 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 25 Sep 2023 15:03:56 -0400 Subject: [PATCH 1/3] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 8586cd5ad8a7fa4f84b5913cbeaf634d68500095 5c9509d2765f2cc803757b2d151a672f8571ab15 --

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > runtime, whereas a `consteval` one cannot. WDYT? > > This makes sense to me. Also, see my comment on #67376. It looks like someone > else is messing with this area as well, and are editing things in an > incompatible way, so we should make sure that these don't conflict

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman updated https://github.com/llvm/llvm-project/pull/67360 >From 6e9bcfa7fc5eb3da4592909b9e199215064df700 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 25 Sep 2023 15:03:56 -0400 Subject: [PATCH 1/2] Diagnose problematic uses of constructor/destructor att

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
erichkeane wrote: > runtime, whereas a `consteval` one cannot. WDYT? This makes sense to me. Also, see my comment on https://github.com/llvm/llvm-project/pull/67376. It looks like someone else is messing with this area as well, and are editing things in an incompatible way, so we should mak

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Erich Keane via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman resolved https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Should they be valid for `constexpr` functions? Sure, but perhaps not for `consteval` functions. A `constexpr` function can be deferred to runtime, whereas a `consteval` one cannot. WDYT? https://github.com/llvm/llvm-project/pull/67360

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-26 Thread Aaron Ballman via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Timm Baeder via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Erich Keane via cfe-commits
@@ -171,6 +171,11 @@ Attribute Changes in Clang automatic diagnostic to use parameters of types that the format style supports but that are never the result of default argument promotion, such as ``float``. (`#59824: `_)

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik commented: Should they be valid for `constexpr` functions? https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/67360 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread via cfe-commits
@@ -2352,26 +2352,61 @@ static void handleUnusedAttr(Sema &S, Decl *D, const ParsedAttr &AL) { D->addAttr(::new (S.Context) UnusedAttr(S.Context, AL)); } -static void handleConstructorAttr(Sema &S, Decl *D, const ParsedAttr &AL) { - uint32_t priority = ConstructorAttr::Def

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Changes Functions with these attributes will be automatically called before main() or after main() exits gracefully, which means the functions should not accept arguments or have a returned value (nothing can provide an argument to the call in th

[clang] Diagnose problematic uses of constructor/destructor attribute (PR #67360)

2023-09-25 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/67360 Functions with these attributes will be automatically called before main() or after main() exits gracefully, which means the functions should not accept arguments or have a returned value (nothing can provi