[clang] [Clang] Introduce __builtin_meow_synthesises_from_spaceship (PR #155612)

2025-08-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This is clever: that way we know it's a pure optimization to call spaceship > instead of less-than twice. IIUC you'd plan to use this from libc++ to > optimize eg __find_equal even on user-defined types? Yes, exactly. https://github.com/llvm/llvm-project/pull/155612 __

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > No. We can drop `_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS` and > > `_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS` by replacing it with > > `_LIBCPP_EXPORTED_FROM_ABI`. > > But how will that work when building with MinGW or MSVC? Or is that not > supported? Is is supported and keeps

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-25 Thread Nikolas Klauser via cfe-commits
@@ -65,15 +65,31 @@ void GH104391() { M; // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}} } +struct S4 get_s_ignored(void) __attribute__((candiscard)); philnik777 wrote: There doesn't seem to be any testing for

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: /cherry-pick 8b3d4bd https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Also, please remove any CCs in the description. This causes a ping to the people every time the commit is pushed anywhere on GitHub, causing a lot of spam. https://github.com/llvm/llvm-project/pull/154943 ___

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
@@ -199,6 +199,10 @@ Removed Compiler Flags Attribute Changes in Clang -- +- A new attribute ``[[clang::candiscard]]`` can be applied to a function returning a nodiscard type philnik777 wrote: IMO `discardable` would be a good name, b

[clang] [clang] Add the candiscard attribute to suppress nodiscard (PR #154943)

2025-08-22 Thread Nikolas Klauser via cfe-commits
@@ -3646,6 +3646,14 @@ def Unavailable : InheritableAttr { let MeaningfulToClassTemplateDefinition = 1; } +def CanDiscard : InheritableAttr { + let Spellings = [CXX11<"clang", "candiscard">, + GCC<"candiscard">]; philnik777 wrote: I don't

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @tbaederr Thanks! I'll merge it once the fix on our side is ready. https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 milestoned https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [clang] Remove hasValue() check in `RecordExprEvaluator::VisitCXXConstructExpr()` (PR #154610)

2025-08-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Thanks for having a look so quickly! https://github.com/llvm/llvm-project/pull/154610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C++] Expose nullptr_t from stddef.h in C++ mode (PR #154599)

2025-08-21 Thread Nikolas Klauser via cfe-commits
@@ -16,7 +16,8 @@ #define _NULLPTR_T #ifdef __cplusplus -#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED) +#if __cplusplus >= 201103L || \ +(defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED))

[clang] [Clang] Add builtins for masked vector loads / stores (PR #154464)

2025-08-20 Thread Nikolas Klauser via cfe-commits
@@ -1232,6 +1232,18 @@ def ConvertVector : Builtin { let Prototype = "void(...)"; } +def MaskedLoad : Builtin { + let Spellings = ["__builtin_masked_load"]; + let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr]; philnik777 wrote: This also is

[libunwind] [libunwind] Use consistent indentation in `__libunwind_config.h` (PR #152861)

2025-08-11 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: Should we maybe just set `IndentPPDirectives: AfterHash`? We already do that in libc++, libc++abi and (I think) compiler-rt. https://github.com/llvm/llvm-project/pull/152861 ___ cfe-commits mailing list cfe-com

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-08-11 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Ping https://github.com/llvm/llvm-project/pull/133699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-07-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Thank you for the update! We can work around this for now, and the impact is > quite limited, but it would be nice to get this working again relatively soon. Absolutely. This is definitely a bug of some sort in libc++. I hope I'll be able to talk to @ldionne tomorrow so we

[clang] [clang][NFC] Run `modernize-use-using` check over all the code (PR #149934)

2025-07-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: I agree with @JDevlieghere that this is essentially a large-scale reformatting. I'd definitely reject it if proposed as-is in libc++ (though we do have a lot more `typedef`s in the code base than Clang). https://github.com/llvm/llvm-project/pull/149934

[clang] [clang][NFC] Run `modernize-use-using` check over all the code (PR #149934)

2025-07-25 Thread Nikolas Klauser via cfe-commits
@@ -21,7 +21,7 @@ namespace driver { namespace tools { namespace mips { -typedef enum { Legacy = 1, Std2008 = 2 } IEEE754Standard; +using IEEE754Standard = enum { Legacy = 1, Std2008 = 2 }; philnik777 wrote: ```suggestion enum IEEE754Standard { Legacy = 1, St

[clang] [clang][NFC] Run `modernize-use-using` check over all the code (PR #149934)

2025-07-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/149934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Enable -Wmissing-prototypes (PR #116261)

2025-07-23 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116261 >From e62e2638cfee1d01f3128f736564b1df4471131e Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 14 Nov 2024 18:30:39 +0100 Subject: [PATCH] [libc++] Enable -Wmissing-prototypes --- libcxx/include/f

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-07-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @alexfh Could you maybe provide a reproducer without a dependency on Google Test? I don't easily have access to that, and it shouldn't be too hard to remove that. It looks to me like it's instantiating the variant constructor with something, but unfortunately the diagnostics

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-15 Thread Nikolas Klauser via cfe-commits
@@ -59,7 +59,7 @@ constexpr bool test() { { // bidi -int buffer[2] = {1, 2}; +int buffer[3] = {1, 2, 3}; philnik777 wrote: Ah, shit. You can't actually get the iterator. I think this is fine as-is. https://github.com/llvm/llvm-project/pull/143

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. https://github.com/llvm/llvm-project/pull/143667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Diagnose forming references to nullptr (PR #143667)

2025-07-10 Thread Nikolas Klauser via cfe-commits
@@ -59,7 +59,7 @@ constexpr bool test() { { // bidi -int buffer[2] = {1, 2}; +int buffer[3] = {1, 2, 3}; philnik777 wrote: I guess the out of bounds read was in line 79? I think we should rather fix getting the address. Right now we'd not iter

[clang] [clang-cl] Support /stdc:latest (PR #147284)

2025-07-07 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: You've got the same typo (?) in a bunch of places. You have `/stdc:latest` instead of `/std:clatest`. Same for `/std:c++latest`. https://github.com/llvm/llvm-project/pull/147284 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-07-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/121199 >From 273d0e6149a8326284ec1e385e83c8728c41ff68 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 27 Sep 2024 22:11:14 +0200 Subject: [PATCH] [Clang] Add __builtin_common_reference --- clang/docs/Lan

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-07-02 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > Thank you all for weighing in here. It seems there is some disagreement on > > how to move forward with this. I believe the current change addresses the > > initial issue this PR is tied to, which aimed to clarify this attribute > > affects more than just explicit special

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 I'm encountering a number of test failures related to libc++'s > clang-tidy module when running the libc++ test suite with the new compiler: > > ``` > # .---command stdout > # | > /home/eric/llvm-project/build/libcxx/libcxx/test-suite-install/include

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/14] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/13] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/13] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/12] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/11] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/11] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/145653 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 01/10] [Clang] Add __builtin_invoke and recognize std::invoke

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/9] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/145653 >From 5b1e8206ef1e69a4304178f45732b3b1a4b0a59e Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Wed, 25 Jun 2025 10:43:08 +0200 Subject: [PATCH 1/2] [Clang] Allow the use of [[gnu::visibility]] with #prag

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This is missing test coverage for the interesting cases. > > I'm a bit worried about how easy it will be to apply this attribute in > unexpected places. e.g., it will apply to member functions as well as free > functions, will anyone expect that though? This is explicitly

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/8] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [llvm] Triple: Forward declare Twine and remove include (PR #145685)

2025-06-26 Thread Nikolas Klauser via cfe-commits
@@ -349,7 +350,12 @@ class Triple { /// triple fields unknown. Triple() = default; + LLVM_ABI explicit Triple(std::string &&Str); philnik777 wrote: That is indeed the case. Technically there is an additional `move`, OTOH that pretty much never matters,

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-25 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman Are any of these concerns specific to `[[gnu::visibility]]`? The exact same concerns seem to apply to any other attribute that applies to functions. https://github.com/llvm/llvm-project/pull/145653 ___ cfe-commits mail

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-25 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Ping @AaronBallman https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (PR #145653)

2025-06-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/145653 I don't see any reason this shouldn't be allowed. AFAICT this is only disabled due to the heuristics used to determine whether it makes sense to allow the use of an attribute with `#pragma clang attribute`.

[clang] [libcxx] [libc++][Clang] Added explanation why is_constructible evaluated to false. Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-24 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > > @philnik777 Is it my fault that tests fail with `Error: Process completed > > > with exit code 255`? > > > > > > No, it's the CI being problematic. I've restarted the failed CI. > > Hmmm CI is still failing but with msan issues. Is this still CI being > problematic?

[clang] Suppress noreturn warning if last statement in a function is a throw (PR #145166)

2025-06-23 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I feel like this is a solution that can grow out of hand very easily. IMO the better solution would be to have `-Wmissing-noreturn` place a `[[noreturn]]` into the AST to avoid incorrect follow-up diagnostics. https://github.com/llvm/llvm-project/pull/145166 _

[clang] [Clang] Implement diagnostics for why `std::is_standard_layout` is false (PR #144161)

2025-06-19 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/144161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++][Clang] Added explanation why is_constructible evaluated to false. Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-19 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 Is it my fault that tests fail with `Error: Process completed > with exit code 255`? No, it's the CI being problematic. I've restarted the failed CI. https://github.com/llvm/llvm-project/pull/144220 ___ cfe-commits mai

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-06-16 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Oh, also note that by default there will still be diagnostics about all incorrect placements. You'll have to opt-in to silently ignoring incorrect placements via `-Wno-dllexport-explicit-instantiation` (assuming I did things correctly). https://github.com/llvm/llvm-project/p

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-06-16 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > I too had trouble understanding this change based on the description. Could > > you give a concrete example of how mingw and msvc disagree on where to put > > the attribute, and explain how this pr changes things? ``` template class S {}; extern template class __declspe

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-06-16 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/133699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Allow simpler visibility annotations when targeting win32 and mingw (PR #133699)

2025-06-16 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: ping @erichkeane @cor3ntin @zmodem https://github.com/llvm/llvm-project/pull/133699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-16 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. The libc++ changes LGTM. https://github.com/llvm/llvm-project/pull/144220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-16 Thread Nikolas Klauser via cfe-commits
@@ -124,8 +126,8 @@ void test() { #if _LIBCPP_HAS_EXCEPTIONS // expected-error-re@*:* {{call to deleted constructor of{{.* // expected-error-re@*:* {{call to deleted constructor of{{.* - // expected-error-re@*:* {{call to deleted constructor of{{.* - // expect

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-16 Thread Nikolas Klauser via cfe-commits
@@ -124,8 +126,8 @@ void test() { #if _LIBCPP_HAS_EXCEPTIONS // expected-error-re@*:* {{call to deleted constructor of{{.* // expected-error-re@*:* {{call to deleted constructor of{{.* - // expected-error-re@*:* {{call to deleted constructor of{{.* - // expect

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-16 Thread Nikolas Klauser via cfe-commits
@@ -28,14 +28,15 @@ int main(int, char**) { { MoveOnly mo[] = {MoveOnly{3}}; // expected-error@array:* {{to_array requires copy constructible elements}} -// expected-error-re@array:* (call to implicitly-deleted copy constructor of 'MoveOnly')|(call to deleted

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/8] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/144220 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-15 Thread Nikolas Klauser via cfe-commits
@@ -55,6 +55,7 @@ void test() { // expected-error-re@*:* {{static assertion failed {{.*}}The result of f(value()) must be a specialization of std::expected}} // expected-error-re@*:* .*}}cannot be used prior to '::' because it has no members}} // expecte

[clang] [libcxx] [libc++][Clang] Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: > Hi, @AaronBallman! I noticed that the libc++ tests are not using the latest > version of my code. How can I run them with the latest version? Thank you! They are being run with the current trunk, but also with older versions of Clang, because libc++ s

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-13 Thread Nikolas Klauser via cfe-commits
@@ -1547,6 +1547,58 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc, return BuildTypeTrait(Kind, KWLoc, ConvertedArgs, RParenLoc); } +bool Sema::BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT, + QualType RhsT) { + //

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-13 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/7] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/6] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/6] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This looks fine. The meaning is clear. (If anything, the C++ standard should > have a better way to talk about "partial or explicit specializations") Given that the whole argument to change this is that it's closer to the standard wording I don't see how the current change

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/143839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Docs: ambiguous use of "explicitly" in [[clang::no_specializaiton]] (PR #143839)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. This seems incorrect. A specialization is instantiated or an explicit specialization according to https://eel.is/c++draft/temp.spec.general#4, which is definitely _not_ what we mean. https://github.com/llvm/llvm-project/pull

[libunwind] [libunwind] Don't override LINKER_LANGUAGE (PR #143533)

2025-06-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. I don't think this is required, or even works after #143162. https://github.com/llvm/llvm-project/pull/143533 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[libunwind] [libunwind] Remove checks for -nostdlib++ (PR #143162)

2025-06-11 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/143162 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libunwind] [libunwind] Remove checks for -nostdlib++ (PR #143162)

2025-06-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/143162 >From a5c4dbe693af9b1f2dd6ef45aa803453c5fbfe28 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 6 Jun 2025 17:31:23 +0200 Subject: [PATCH] [libunwind] Remove checks for -nostdlib++ --- libunwind/cm

[libunwind] [libunwind] Remove checks for -nostdlib++ (PR #143162)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/143162 libunwind uses a C linker, so it's never even trying to link against any C++ libraries. This removes the code which tries to drop C++ libraries, which makes the CMake configuration simpler and allows for upg

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 ready_for_review https://github.com/llvm/llvm-project/pull/138293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libcxxabi] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From 633b22215dd7b4addf5a9e1718a76030dd37f9e9 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-06 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From 932b62f3a1f5cc7b69a9f2d0e794c511da0eaa6a Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[clang] Thread Safety Analysis: Support reentrant capabilities (PR #137133)

2025-06-02 Thread Nikolas Klauser via cfe-commits
@@ -3990,6 +3990,13 @@ def LocksExcluded : InheritableAttr { let Documentation = [Undocumented]; } +def ReentrantCapability : InheritableAttr { + let Spellings = [Clang<"reentrant_capability">]; + let Subjects = SubjectList<[Record, TypedefName]>; + let Documentation = [U

[clang] [clang] Add attribute [[clang::builtin]] (PR #78071)

2025-06-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/78071 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From 68a5c9df4e5dc4599a97ccd24b95708ac0e0a327 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-06-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From 29273cf49b2cae51f6eee43970deb547272eb97f Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-30 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Gentle ping @AaronBallman @cor3ntin https://github.com/llvm/llvm-project/pull/116709 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This seems reasonable to me? I'm not a huge fan of how much is being put into > `SemaTemplate.cpp` to support all the builtins though. I'm wondering if we > need to split that up in a follow-up and have a `SemaTemplateBuiltins` for > all of these to live. I can take a look

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-27 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-05-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From e735a57745e840f4a19bdd433e823a851890bcbe Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[libcxx] [libunwind] [llvm] [libc++] Upgrade to GCC 15 (PR #138293)

2025-05-27 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/138293 >From d19c634bc341b33a15ddf05de556fddd4d1bf168 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 2 May 2025 17:24:13 +0200 Subject: [PATCH] [libc++] Upgrade to GCC 15 --- .github/workflows/libcxx-bu

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-24 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-24 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_common_reference (PR #121199)

2025-05-24 Thread Nikolas Klauser via cfe-commits
@@ -3231,6 +3241,230 @@ static QualType builtinCommonTypeImpl(Sema &S, TemplateName BaseTemplate, } } +static QualType CopyCV(QualType From, QualType To) { + if (From.isConstQualified()) +To.addConst(); + if (From.isVolatileQualified()) +To.addVolatile(); + retur

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-22 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Thanks for working on that. Do you have any benchmarks? I haven't benchmarked extensively, but as stated in the commit message, The instantiation of `std::format` is ~20ms faster. IMO that's a significant enough speedup on its own that it grants adding a builtin. I've jus

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-22 Thread Nikolas Klauser via cfe-commits
@@ -6540,67 +6540,70 @@ ExprResult Sema::ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc, return BuildTypeTrait(Kind, KWLoc, ConvertedArgs, RParenLoc); } -static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceInfo *Lhs, -

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/5] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/4] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/3] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
@@ -5406,6 +5408,103 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + SourceLocation Loc = TheCall->getBeginLoc(); + auto Ar

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
@@ -5406,6 +5408,101 @@ ExprResult Sema::ConvertVectorExpr(Expr *E, TypeSourceInfo *TInfo, RParenLoc, CurFPFeatureOverrides()); } +ExprResult Sema::BuiltinInvoke(CallExpr *TheCall) { + auto Loc = TheCall->getBeginLoc(); + auto Args = Mutab

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/116709 >From e0bb550672326e21a556ac727f2e2a6ef65f0469 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Oct 2024 11:08:02 +0200 Subject: [PATCH 1/2] [Clang] Add __builtin_invoke and recognize std::invoke a

[clang] [libcxx] [Clang] Add __builtin_invoke and use it in libc++ (PR #116709)

2025-05-20 Thread Nikolas Klauser via cfe-commits
@@ -1611,29 +1611,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, Tok.isOneOf( #define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) tok::kw___##Trait, #include "clang/Basic/TransformTypeTraits.def" - tok::kw___is_abstract, - tok::kw___is_aggregat

  1   2   3   4   5   6   7   >