[clang] [Clang] Remove __is_nullptr from the list of type traits (PR #109533)

2024-09-22 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/109533 ___ 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_type (PR #99473)

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

[clang] d296902 - [Clang] Remove __is_nullptr from the list of type traits

2024-09-21 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-21T18:38:15+02:00 New Revision: d2969022640a94b26b7324241e13d67080554d9f URL: https://github.com/llvm/llvm-project/commit/d2969022640a94b26b7324241e13d67080554d9f DIFF: https://github.com/llvm/llvm-project/commit/d2969022640a94b26b7324241e13d67080554d9f.dif

[clang] [Clang] Remove __is_nullptr from the list of type traits (PR #109533)

2024-09-21 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/109533 Support for `__is_nullptr` was removed in #99038, but I forgot to remove it from the list of type traits, resulting in Clang crashing when one tries to use it. >From db8690cdbc2a218692d8fc83398beecf8853bae

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

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

[clang-tools-extra] e392056 - Reapply "Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (#108453)"

2024-09-14 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-14T22:25:08+02:00 New Revision: e39205654dc11c50bd117e8ccac243a641ebd71f URL: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f DIFF: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f.dif

[clang] e392056 - Reapply "Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (#108453)"

2024-09-14 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-14T22:25:08+02:00 New Revision: e39205654dc11c50bd117e8ccac243a641ebd71f URL: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f DIFF: https://github.com/llvm/llvm-project/commit/e39205654dc11c50bd117e8ccac243a641ebd71f.dif

[clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)

2024-09-14 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: gentle ping~ https://github.com/llvm/llvm-project/pull/99473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-09-14 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: gentle ping~ https://github.com/llvm/llvm-project/pull/106005 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)

2024-09-13 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: If the implementation is conforming this doesn't do anything. In fact, they have to be the same function. https://github.com/llvm/llvm-project/pull/108529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[clang] [clang-tools-extra] [flang] Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (PR #108453)

2024-09-13 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/108453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [flang] Reapply "[clang] Extend diagnose_if to accept more detailed warning information (#70976)" (PR #108453)

2024-09-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/108453 This reverts commit e0cd11eba526234ca14a0b91f5598ca3363b6aca. Fix flang >From b429f137f3c1e2b2a72c9f3f444f6d43a8b5e35d Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 12 Sep 2024 21:27:27 +0200 S

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/70976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -200,7 +273,33 @@ class DiagnosticIDs : public RefCountedBase { // FIXME: Replace this function with a create-only facilty like // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of // writing, nearly all callers of this function were invalid.

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -269,11 +268,60 @@ CATEGORY(INSTALLAPI, REFACTORING) return Found; } -DiagnosticMapping DiagnosticIDs::getDefaultMapping(unsigned DiagID) { +//===--===// +// Custom Diagnostic information +//===--

[clang] b433023 - [Clang][NFC] Remove trailing whitespace from clang/tools/libclang/CXStoredDIagnostic.cpp

2024-09-12 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2024-09-12T15:43:27+02:00 New Revision: b43302372f592fd48a22d32b2603f8efee40a88e URL: https://github.com/llvm/llvm-project/commit/b43302372f592fd48a22d32b2603f8efee40a88e DIFF: https://github.com/llvm/llvm-project/commit/b43302372f592fd48a22d32b2603f8efee40a88e.dif

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -200,7 +273,33 @@ class DiagnosticIDs : public RefCountedBase { // FIXME: Replace this function with a create-only facilty like // createCustomDiagIDFromFormatString() to enforce safe usage. At the time of // writing, nearly all callers of this function were invalid.

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-12 Thread Nikolas Klauser via cfe-commits
@@ -870,7 +872,8 @@ class DiagnosticsEngine : public RefCountedBase { /// \param FormatString A fixed diagnostic format string that will be hashed /// and mapped to a unique DiagID. template - unsigned getCustomDiagID(Level L, const char (&FormatString)[N]) { + [[depr

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-10 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @AaronBallman @erichkeane is there anything else to do before merging? It would be nice to merge this somewhat early in the release cycle, since I suspect this might be reverted a few times. https://github.com/llvm/llvm-project/pull/70976 _

[clang] [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (PR #107815)

2024-09-10 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: /cherry-pick 6dbdb84 https://github.com/llvm/llvm-project/pull/107815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (PR #107815)

2024-09-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 milestoned https://github.com/llvm/llvm-project/pull/107815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (PR #107815)

2024-09-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/107815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang] Add __type_list_dedup builtin to deduplicate types in template arguments (PR #106730)

2024-09-10 Thread Nikolas Klauser via cfe-commits
@@ -309,7 +309,10 @@ enum BuiltinTemplateKind : int { BTK__make_integer_seq, /// This names the __type_pack_element BuiltinTemplateDecl. - BTK__type_pack_element + BTK__type_pack_element, + + /// This names the __type_list_dedup BuiltinTemplateDecl. + BTK__type_list_de

[clang] [clang-tools-extra] [Clang] Add __type_list_dedup builtin to deduplicate types in template arguments (PR #106730)

2024-09-10 Thread Nikolas Klauser via cfe-commits
@@ -309,7 +309,10 @@ enum BuiltinTemplateKind : int { BTK__make_integer_seq, /// This names the __type_pack_element BuiltinTemplateDecl. - BTK__type_pack_element + BTK__type_pack_element, + + /// This names the __type_list_dedup BuiltinTemplateDecl. phi

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-09-09 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > You mean, if all three operands are boolean vectors? I'm surprised that > doesn't already work. No, I mean I have a vector of bools and want to select a value based on that. e.g. `declval>() ? declval>() : declval>()`. https://github.com/llvm/llvm-project/pull/91306 _

[clang] [Clang] Add __builtin_selectvector and use it for AVX512 intrinsics (PR #91306)

2024-09-09 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > clang already supports `?:` with a vector condition; does this add anything > new on top of that? This works with bool vectors. I didn't realize you could use the ternary operator, since I only tested with them. I guess we could extend the ternary operator to accept bool v

[clang] [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (PR #107815)

2024-09-09 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/107815 Fixes #10 >From 0059de326ef8dd01e24f45cb18d9035957e77873 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 9 Sep 2024 09:15:39 +0200 Subject: [PATCH] [Clang] Fix crash due to invalid source loca

[clang] [libcxx] [Clang] Add __builtin_common_type (PR #99473)

2024-09-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/99473 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add `__builtin_experimental_vectorcompress` (PR #102476)

2024-09-08 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: What's the status of this? I'd really like to use it in a libc++ optimization. https://github.com/llvm/llvm-project/pull/102476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-09-07 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH 1/7] [Clang] Add __common_type builtin --- clang/include/cl

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-09-07 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,184 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++17 %s +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++20 %s + +#if !__has_builtin(__builtin_common_type) +# error +#endif + +// expected-note@*:* {{

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-04 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/70976 >From a91f499900d4cea4804833d004b6c4e54a7d8b15 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 3 Sep 2023 17:26:28 -0700 Subject: [PATCH 01/10] [clang] Extend diagnose_if to accept more detailed war

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-04 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/70976 >From a91f499900d4cea4804833d004b6c4e54a7d8b15 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 3 Sep 2023 17:26:28 -0700 Subject: [PATCH 1/9] [clang] Extend diagnose_if to accept more detailed warni

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-09-04 Thread Nikolas Klauser via cfe-commits
@@ -101,91 +102,164 @@ namespace clang { }; } -class DiagnosticMapping { - LLVM_PREFERRED_TYPE(diag::Severity) - unsigned Severity : 3; - LLVM_PREFERRED_TYPE(bool) - unsigned IsUser : 1; - LLVM_PREFERRED_TYPE(bool) - unsigned IsPragma : 1; - LLVM_PREFERRED_TYPE(bo

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-09-03 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { philnik777 wrote: Would it make sense to split this into (1) a diagnostic abou

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-09-03 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 Is this part of a larger scheme covering other targets? Ultimately all the builtins should be in TableGen files instead of the `.def` files, but that's going to take a while. Probably years, since it's not exactly high priority. https://github.com/llvm/llvm-pro

[clang] [Clang][NFC] Don't manually enumerate the PredefinedDeclIDs (PR #106891)

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

[clang] [Clang][NFC] Don't manually enumerate the PredefinedDeclIDs (PR #106891)

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

[clang] [Clang][NFC] Don't manually enumerate the PredefinedDeclIDs (PR #106891)

2024-09-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/106891 This doesn't seem to have any use other than the possibility of merge conflicts and accidentally forgetting to update `NUM_PREDEF_DECL_IDS`. >From 29cd14dff005175d30598f19a370b6ebb48a8c0e Mon Sep 17 00:00:0

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-09-01 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { philnik777 wrote: Yes, that's a supported extension. https://github.com/llvm/

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > > > I did think about it more, and I think it would be more consistent to > > > > support the attribute on any sort of specializable entity, including > > > > functions - regardless of STL needs @AaronBallman @ldionne > > > > > > > > > Agreed; if we're adding a custom at

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > I did think about it more, and I think it would be more consistent to > > support the attribute on any sort of specializable entity, including > > functions - regardless of STL needs @AaronBallman @ldionne > > Agreed; if we're adding a custom attribute, we might as well s

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-28 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { philnik777 wrote: `-nostdlib` doesn't imply that you don't have a standard lib

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-28 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,33 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx11 -pedantic -std=c++11 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx14 -pedantic -std=c++14 %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cxx17 -pedantic -std=c++17 %s +// RUN: %clang_cc1 -

[clang] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] python: use raw strings for regex (PR #105990)

2024-08-27 Thread Nikolas Klauser via cfe-commits
@@ -284,7 +284,7 @@ def sync_csv(rows: List[Tuple], from_github: List[PaperInfo]) -> List[Tuple]: results.append(gh.for_printing()) continue elif paper.status != gh.status: -print(f"We found a CSV row and a Github issue with differen

[clang] [Clang] Add [[clang::no_specializations]] (PR #101469)

2024-08-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Does it makes sense to also support function templates? For example, my > understanding is that specializing `is_pointer_interconvertible_with_class()` > would be UB I can't find anything explicit about function template specializations, so I'm not 100% sure whether it's a

[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

2024-08-26 Thread Nikolas Klauser via cfe-commits
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr, return false; } +static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) { + const LangOptions &Lang = PP.getLangOpts(); + const StringRef Name = II->getName(); + + if

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/6] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Start moving X86Builtins.def to X86Builtins.td (PR #106005)

2024-08-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/106005 This starts moving `X86Builtins.def` to be a tablegen file. It's quite large, so I think it'd be good to move things in multiple steps to avoid a bunch of merge conflicts due to the amount of time this takes

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-20 Thread Nikolas Klauser via cfe-commits
@@ -3327,6 +3330,15 @@ def DiagnoseIf : InheritableAttr { let Documentation = [DiagnoseIfDocs]; } +def DiagnoseSpecializations : InheritableAttr { + let Spellings = [Clang<"diagnose_specializations", /*AllowInC*/0>]; philnik777 wrote: Do explicit specializ

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-20 Thread Nikolas Klauser via cfe-commits
@@ -3327,6 +3330,15 @@ def DiagnoseIf : InheritableAttr { let Documentation = [DiagnoseIfDocs]; } +def DiagnoseSpecializations : InheritableAttr { + let Spellings = [Clang<"diagnose_specializations", /*AllowInC*/0>]; + let Args = [StringArgument<"Message", 1>]; ---

[clang] [flang] [llvm] [C++23] [CLANG] Adding C++23 constexpr math functions: fmin, fmax and frexp. (PR #88978)

2024-08-17 Thread Nikolas Klauser via cfe-commits
@@ -14638,6 +14649,8 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) { return true; } + case Builtin::BIfmin: + case Builtin::BIfminf: philnik777 wrote: I don't think anything should happen to the libc++ documentation in this patch. We

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/5] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-08-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH 1/6] [Clang] Add __common_type builtin --- clang/include/cl

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 Thread Nikolas Klauser via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 %s -verify + +#if !__has_cpp_attribute(clang::diagnose_specializations) +# error +#endif + +struct [[clang::diagnose_specializations]] S {}; // expected-warning {{'diagnose_specializations' attribute only applies to class templates}} + +templ

[clang] [Clang] Remove __is_nullptr (PR #99038)

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

[clang] [Clang] Remove __is_nullptr (PR #99038)

2024-08-04 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99038 >From fbc9ebb3900e69f2485111cfdc6b7a7dfd3e6ebe Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:53:30 +0200 Subject: [PATCH 1/2] [Clang] Remove __is_nullptr --- clang/docs/LanguageExt

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/3] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/101469 >From 82ab798fc72c6de64ae527d96393f0dc67307e98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 1 Aug 2024 12:30:22 +0200 Subject: [PATCH 1/2] [Clang] Add [[clang::diagnose_specializations]] --- cl

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-01 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Also consider adding an argument that lets you diagnose > https://eel.is/c++draft/namespace.std#2.1 > > > * the added declaration depends on at least one program-defined type, > > To diagnose specializations for `std::pair`, but allow > `std::pair`. Given that this seems

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-01 Thread Nikolas Klauser via cfe-commits
@@ -975,6 +975,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``. }]; } +def DiagnoseSpecializationsDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +``clang::diagnose_specializations`` can be appied to class templates which +should

[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

2024-08-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/101469 This can be used to inform users when a template should not be specialized. For example, this is the case for the standard type traits (except for `common_type` and `common_reference`, which have more compli

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-31 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate, + SourceLocation TemplateLoc, + ArrayRef Ts) { + auto lookUpComm

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

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

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-31 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH 1/5] [Clang] Add __common_type builtin --- clang/include/cl

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-31 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate, + SourceLocation TemplateLoc, + ArrayRef Ts) { + auto lookUpComm

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-31 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate, + SourceLocation TemplateLoc, + ArrayRef Ts) { + auto lookUpComm

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-31 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: > How much of a performance difference are you measuring with this change? That depends heavily on what you're looking at. For `common_type`s with a lot of builtin types, I've seen a 10x improvement. When it's basically just combining specializations I'

[clang] [Clang] Remove __is_nullptr (PR #99038)

2024-07-31 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99038 >From fbc9ebb3900e69f2485111cfdc6b7a7dfd3e6ebe Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:53:30 +0200 Subject: [PATCH 1/2] [Clang] Remove __is_nullptr --- clang/docs/LanguageExt

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate, + SourceLocation TemplateLoc, + ArrayRef Ts) { + auto lookUpComm

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,133 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static QualType commonTypeImpl(Sema &S, TemplateName BaseTemplate, + SourceLocation TemplateLoc, + ArrayRef Ts) { + auto lookUpComm

[clang] [clang] Remove `__is_layout_compatible` from revertible type traits list (PR #100572)

2024-07-25 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Should we also rename to `__builtin_is_layout_compatible`? https://github.com/llvm/llvm-project/pull/100572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH 1/4] [Clang] Add __common_type builtin --- clang/include/cl

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH 1/2] [Clang] Add __common_type builtin --- clang/include/cl

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-25 Thread Nikolas Klauser via cfe-commits
@@ -1599,13 +1599,66 @@ createTypePackElementParameterList(const ASTContext &C, DeclContext *DC) { nullptr); } +static TemplateParameterList *createCommonTypeList(const ASTContext &C, + D

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-23 Thread Nikolas Klauser via cfe-commits
@@ -6844,6 +6844,14 @@ CXXRecordMembersNamed(StringRef Name, Sema &S, QualType Ty) { return Results; } +QualType Sema::getTypeMember(StringRef Name, QualType Type) { philnik777 wrote: `CXXRecordMembersNamed` is used in `hasCStrMethod` below as well. Should

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,141 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static std::optional commonTypeImpl(Sema &S, + TemplateName BaseTemplate, + SourceLocation TemplateLoc

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
@@ -3058,6 +3058,141 @@ void Sema::NoteAllFoundTemplates(TemplateName Name) { } } +static std::optional commonTypeImpl(Sema &S, + TemplateName BaseTemplate, + SourceLocation TemplateLoc

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

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

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d6903daf0da6979822b8981ea3641455ff6d06f8 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH] [Clang] Add __common_type builtin --- clang/include/clang/

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From f034248ddb55ff2184662e0558c078f8109c0e00 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH] [Clang] Add __common_type builtin --- clang/include/clang/

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From d11417d4addd7a5da5436e9fb406748a3059e17c Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH] [Clang] Add __common_type builtin --- clang/include/clang/

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-19 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From 22513d53967ac32ae4112499c33c7c481b52b2fd Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH] [Clang] Add __common_type builtin --- clang/include/clang/

[clang] [libcxx] [Clang] Add __common_type builtin (PR #99473)

2024-07-18 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/99473 >From f9b9431a97952909190c69e1dee188ef234addb2 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 16 Jul 2024 14:48:10 +0200 Subject: [PATCH] [Clang] Add __common_type builtin --- clang/include/clang/

[clang] [Clang] Add __common_type builtin (PR #99473)

2024-07-18 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/99473 This implements the logic of the `common_type` base template as a builtin alias. If there should be no `type` member, an empty class is returned. Otherwise a specialization of a `type_identity`-like class is

[clang] [Clang] Remove __is_nullptr (PR #99038)

2024-07-16 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > I mostly support the removal but I'd feel more comfortable documenting the > extension as deprecated in Clang 19, adding a release note warning users > about it going away and what the replacement code would look like, and then > remove `__is_nullptr()` in Clang 20. (edited

[clang] [Clang] Remove __is_nullptr (PR #99038)

2024-07-16 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/99038 `is_null_pointer` can be implemented very efficiently as `__is_same(__remove_cv(T), decltype(nullptr))`. Since GCC supports both of these builtins as well, libc++ has no interest in using `__is_nullptr` inste

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-07-14 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/70976 >From a91f499900d4cea4804833d004b6c4e54a7d8b15 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sun, 3 Sep 2023 17:26:28 -0700 Subject: [PATCH 1/7] [clang] Extend diagnose_if to accept more detailed warni

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-07-14 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 %s -verify -fno-builtin -Werror=comment -Wno-error=abi -Wfatal-errors=assume -Wno-fatal-errors=assume + +#define diagnose_if(...) __attribute__((diagnose_if(__VA_ARGS__))) + +template +void diagnose_if_wcomma() diagnose_if(b, "oh no", "warnin

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 I would rather not, at least for the review, manipulating two > branches will be cumbersome. I can split it before merging, but as I don't > expect this to happen soon, it should be fine. This is less about having two separate commits than having mostly unrelate

[clang] [libcxx] [clang] [libc++] P3309 constexpr atomic and atomic ref [WIP] (PR #98738)

2024-07-13 Thread Nikolas Klauser via cfe-commits
Hana =?utf-8?q?Dusíková?= , Hana =?utf-8?q?Dusíková?= Message-ID: In-Reply-To: philnik777 wrote: Could you split this up into separate patches for the Clang and libc++ changes? The Clang changes can probably be landed independently of LWG, but for the libc++ changes we almost always wait

[clang] Reapply "[Clang] Fix __is_trivially_equality_comparable returning true with ineligebile defaulted overloads" (#97002) (PR #97894)

2024-07-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 closed https://github.com/llvm/llvm-project/pull/97894 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-07-10 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,45 @@ +// RUN: %clang_cc1 %s -verify -fno-builtin -Werror=comment -Wno-error=abi -Wfatal-errors=assume -Wno-fatal-errors=assume + +#define diagnose_if(...) __attribute__((diagnose_if(__VA_ARGS__))) + +template +void diagnose_if_wcomma() diagnose_if(b, "oh no", "warnin

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

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

[clang] [clang-tools-extra] [clang] Extend diagnose_if to accept more detailed warning information (PR #70976)

2024-07-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: > Sorry for the delay in review! No worries! I dropped this for a few months myself. I can't expect to get a review within days when doing that :D > This seems like the right direction to go, in general. As @erichkeane, it's a > bit hard to review due

  1   2   3   4   >