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

2023-12-09 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] [clang] Extend diagnose_if to accept more detailed warning i

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

2023-12-09 Thread Nikolas Klauser via cfe-commits
@@ -171,13 +172,61 @@ class DiagnosticMapping { class DiagnosticIDs : public RefCountedBase { public: /// The level of the diagnostic, after it has been through mapping. - enum Level { + enum Level : uint8_t { Ignored, Note, Remark, Warning, Error, Fatal }; + //

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][span] P2821R5: span.at() (PR #74994)

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

[clang-tools-extra] [libcxx] [clang] [llvm] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -41,7 +41,6 @@ void testRuntimeSpan(Span sp, std::size_t idx) assert(r1 == r2); } -struct A{}; philnik777 wrote: Unrelated change? https://github.com/llvm/llvm-project/pull/74994 ___ cfe-commits mailing list

[llvm] [libcxx] [clang-tools-extra] [clang] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 requested changes to this pull request. Looks mostly good, but I have a few small comments. https://github.com/llvm/llvm-project/pull/74994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[llvm] [libcxx] [clang] [clang-tools-extra] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [clang] [llvm] [libcxx] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -343,6 +347,15 @@ public: return __data_[__idx]; } +# if _LIBCPP_STD_VER >= 26 +_LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __idx) const { + if (__idx >= size()) { +__throw_out_of_range(); + } + return *(data() + __idx); --

[clang-tools-extra] [clang] [llvm] [libcxx] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm] [clang-tools-extra] [libcxx] [clang] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libcxx] [clang] [llvm] [clang-tools-extra] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -343,6 +347,15 @@ public: return __data_[__idx]; } +# if _LIBCPP_STD_VER >= 26 +_LIBCPP_HIDE_FROM_ABI constexpr reference at(size_type __idx) const { + if (__idx >= size()) { +__throw_out_of_range(); + } + return *(data() + __idx); --

[llvm] [clang-tools-extra] [libcxx] [clang] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-10 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[flang] [clang-tools-extra] [compiler-rt] [libcxxabi] [openmp] [libcxx] [clang] [mlir] [libc] [llvm] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2023-12-11 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I seem to be the only one, but I don't understand how this isn't shadowing. The whole point of the shadowing warning is to avoid confusion about which variable is actually used, which IMO could very well be the case here. I think it would be much better to get a new flag to d

[clang] [Clang] Allow the use of consecutive brackets as an extension in C++03 (PR #75148)

2023-12-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/75148 None >From be2654702d4e7bc3b8689662db6011a3e148ef4d Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 12 Dec 2023 08:47:26 +0100 Subject: [PATCH] [Clang] Allow the use of consecutive brackets as an ex

[clang] [Clang] Allow the use of consecutive brackets as an extension in C++03 (PR #75148)

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

[clang] [Clang][docs] Update extension documentation (PR #75150)

2023-12-12 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/75150 This is back-ported to C++03 now, since clang accepts C++11 attributes in C++03. https://godbolt.org/z/f7xG18bdE >From fbc41ef81ff8d4b647f45dfbeca20d4428ce0c98 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser

[clang] [Clang][docs] Update extension documentation (PR #75150)

2023-12-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I'm landing this, since this shouldn't be in any way controversial. https://github.com/llvm/llvm-project/pull/75150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][docs] Update extension documentation (PR #75150)

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

[clang] [WIP][libc++] Add builtin to clear padding bytes (prework for P0528R3) (PR #75371)

2023-12-13 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I don't think this should be tagged as libc++, since it doesn't actually touch anything of libc++. https://github.com/llvm/llvm-project/pull/75371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin

[openmp] [lldb] [mlir] [clang] [flang] [libcxx] [libc] [compiler-rt] [llvm] [clang-tools-extra] [libc++][span] P2821R5: span.at() (PR #74994)

2023-12-18 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libcxx] [compiler-rt] [clang-tools-extra] [lldb] [mlir] [llvm] [lld] [clang] [libc++][ranges] Implement ranges::contains_subrange (PR #66963)

2023-12-18 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,145 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libcxx] [mlir] [lld] [lldb] [compiler-rt] [llvm] [clang] [clang-tools-extra] [libc++][ranges] Implement ranges::contains_subrange (PR #66963)

2023-12-18 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,145 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-11-27 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Was there an RFC asking the community about exposing lambdas in pre C++11 > modes? This is a sufficiently large language extension that we probably > should verify if we haven't already. I believe this is a conforming extension > (I can't think of a circumstance under which

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

2023-11-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: gentle ping~ 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] Move documentation about -verify from a header to public docs (PR #73694)

2023-11-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Would it make sense to document this more publicly? While it's designed to be an internal tool, it's really useful for people who want to make sure their library produces high quality diagnostics (e.g. `nodiscard`, `static_assert`s etc.). I'm sure you are aware that libc++ us

[clang-tools-extra] [flang] [libunwind] [libcxx] [lldb] [llvm] [mlir] [compiler-rt] [clang] [libcxxabi] [lld] [libc] Implement libcxx ranges contains (PR #70258)

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

[lld] [clang] [llvm] [clang-tools-extra] [flang] [libunwind] [libc] [libcxxabi] [libcxx] [lldb] [compiler-rt] [mlir] [libc++] Implement ranges::contains (PR #65148)

2023-11-28 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 reopened https://github.com/llvm/llvm-project/pull/65148 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[lldb] [llvm] [clang-tools-extra] [libcxx] [libcxxabi] [libc] [mlir] [flang] [libunwind] [compiler-rt] [clang] [lld] [libc++] Implement ranges::contains (PR #65148)

2023-11-28 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/65148 >From 02e9afd761228f401df4d9f8dfaaca44ffae0c6e Mon Sep 17 00:00:00 2001 From: zijunzhao Date: Thu, 31 Aug 2023 20:08:32 + Subject: [PATCH 01/17] [libc++] Implement ranges::contains Differential Revision:

[libcxx] [clang-tools-extra] [libc] [flang] [lld] [compiler-rt] [llvm] [libunwind] [mlir] [clang] [libcxxabi] [lldb] Implement libcxx ranges contains (PR #70258)

2023-11-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I've reopened the old one for you. Let's keep the discussion in one place. https://github.com/llvm/llvm-project/pull/70258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-11-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-11-29 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 edited https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-11-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @shafik See https://discourse.llvm.org/t/rfc-allow-c-11-lambdas-in-c-03-as-an-extension/75262 https://github.com/llvm/llvm-project/pull/73376 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2023-12-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/74110 I've come across this while working on implementing lambdas in C++03. >From 563f86bddc0ec59b63c6aeffee2342f027c09119 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 1 Dec 2023 18:16:36 +0100 Subjec

[clang] [CUDA] work around more __noinline__ conflicts with libc++ (PR #74123)

2023-12-01 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,10 @@ +// CUDA headers define __noinline__ which interferes with libc++'s use of +// `__attribute((__noinline__))`. In order to avoid compilation error, +// temporarily unset __noinline__ when we include affected libstdc++ header. philnik777 wrote: ```

[clang] [CUDA] work around more __noinline__ conflicts with libc++ (PR #74123)

2023-12-01 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,10 @@ +// CUDA headers define __noinline__ which interferes with libc++'s use of +// `__attribute((__noinline__))`. In order to avoid compilation error, +// temporarily unset __noinline__ when we include affected libstdc++ header. philnik777 wrote: ```

[clang] [CUDA] work around more __noinline__ conflicts with libc++ (PR #74123)

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

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-12-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/73376 >From 563f86bddc0ec59b63c6aeffee2342f027c09119 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 1 Dec 2023 18:16:36 +0100 Subject: [PATCH 1/2] [clang] Fix crash when declaring invalid lambda member -

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2023-12-02 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > The tests changes look mostly unrelated to this PR They mostly are. I found this while trying to check C++03 with the test and noticed that C++11 also crashes, so I updated the test to also run in C++11. https://github.com/llvm/llvm-project/pull/74110 __

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

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

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-12-02 Thread Nikolas Klauser via cfe-commits
@@ -92,14 +94,14 @@ namespace ImplicitCapture { [] { return ref_i; }; // expected-error {{variable 'ref_i' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} expected-note 2 {{capture 'ref_i' by}} e

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2023-12-02 Thread Nikolas Klauser via cfe-commits
@@ -92,14 +94,14 @@ namespace ImplicitCapture { [] { return ref_i; }; // expected-error {{variable 'ref_i' cannot be implicitly captured in a lambda with no capture-default specified}} expected-note {{lambda expression begins here}} expected-note 2 {{capture 'ref_i' by}} e

[llvm] [libcxx] [libunwind] [libc++] Allow running the test suite with optimizations (PR #68753)

2023-12-03 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. https://github.com/llvm/llvm-project/pull/68753 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Builtin] add __builtin_exit (PR #74803)

2023-12-21 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I'm not really convinced that `__builtin_exit` is widely used. If you filter for C/C++ and exclude GCC there aren't many matches: https://sourcegraph.com/search?q=context:global+__builtin_exit+count:all+-file:gcc/.*+%28lang:C+OR+lang:C%2B%2B%29&patternType=standard&sm=0&groupB

[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

2023-12-30 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 commented: While I disagree with the reasoning for not just using `std` (@MaxEW707 I think having a chat about this informally would be nice.), I do think it makes sense to add the ability to declare some functions as builtins. There are a few cases inside the sta

[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

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

[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

2023-12-30 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s + +namespace mystd { +inline namespace bar { +template struct remove_reference { typedef T type; }; +template struct remove_reference { typedef T type; }; +template struct remove_reference { typedef T type

[clang] [clang] Add `clang::behaves_like_std(...)` attribute (PR #76596)

2023-12-31 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 Do `std::move`/ `std::forward` etc actually need an abi tag? > Maybe we should simply not set a tag given that clang / gcc replace call to > these functions. If that were always the case we could simply provide a declaration without ever defining the function,

[compiler-rt] [clang] [libcxx] [lldb] [mlir] [llvm] [libc] [openmp] [flang] [clang-tools-extra] [libc++][span] P2821R5: `span.at()` (PR #74994)

2024-01-01 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. Other than the test this LGTM. https://github.com/llvm/llvm-project/pull/74994 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [flang] [libcxx] [openmp] [llvm] [compiler-rt] [clang-tools-extra] [mlir] [libc] [libc++][span] P2821R5: `span.at()` (PR #74994)

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

[llvm] [compiler-rt] [libcxx] [libc] [openmp] [lldb] [mlir] [clang] [flang] [clang-tools-extra] [libc++][span] P2821R5: `span.at()` (PR #74994)

2024-01-01 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,136 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[llvm] [clang-tools-extra] [lld] [libcxx] [clang] [flang] [compiler-rt] [libc++][ranges] P2116R9: Implements `views::enumerate` (PR #73617)

2024-01-03 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,333 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[libcxx] [lld] [compiler-rt] [llvm] [flang] [clang-tools-extra] [clang] [libc++][ranges] P2116R9: Implements `views::enumerate` (PR #73617)

2024-01-03 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,333 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [flang] [lld] [compiler-rt] [llvm] [clang-tools-extra] [libcxx] [libc++][ranges] P2116R9: Implements `views::enumerate` (PR #73617)

2024-01-03 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,333 @@ +// -*- C++ -*- +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License

[clang] [clang-tools-extra] [libunwind] [lldb] [libc] [compiler-rt] [libcxx] [flang] [llvm] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,123 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[compiler-rt] [clang] [libc] [llvm] [libcxx] [clang-tools-extra] [lldb] [flang] [libunwind] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,123 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[libunwind] [libc] [compiler-rt] [llvm] [clang] [lldb] [clang-tools-extra] [flang] [libcxx] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -46,7 +46,7 @@ "`P2255R2 `__","LWG","A type trait to detect reference binding to temporary","February 2022","","" "`P2273R3 `__","LWG","Making ``std::unique_ptr`` constexpr","February 2022","|Complete|","16.0" "`P2387R3

[clang] [compiler-rt] [libunwind] [flang] [llvm] [libcxx] [libc] [lldb] [clang-tools-extra] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,123 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang-tools-extra] [libcxx] [libunwind] [lldb] [clang] [compiler-rt] [libc] [flang] [llvm] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,123 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[compiler-rt] [clang] [flang] [libunwind] [libc] [clang-tools-extra] [llvm] [libcxx] [lldb] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -13,7 +13,7 @@ // Range algorithms should return `std::ranges::dangling` when given a dangling range. philnik777 wrote: The formatting changes in here are nice, but would be better handled in a separate PR, just to make it clear what actually changed. ht

[lldb] [libunwind] [libcxx] [llvm] [libc] [compiler-rt] [clang-tools-extra] [flang] [clang] [libc++] Implement ranges::iota (PR #68494)

2024-01-05 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,123 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apa

[clang] [llvm] [libcxx] "Reapply "[Sema] Fix crash on invalid code with parenthesized aggrega… (PR #76833)

2024-01-06 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: @mordante The lines could be changed to `// expected-error-re@*:* 0-1 (excess elements in struct initializer|no matching constructor for initialization of)}}{{.*` to still have coverage. FWIW the `{{.*}}` at the end seems to be redundant too. https://github.com/llvm/

[clang] [clang][NFC] Refactor Builtins.def to be a tablegen file (PR #68324)

2024-01-06 Thread Nikolas Klauser via cfe-commits
@@ -0,0 +1,333 @@ +//=- ClangDiagnosticsEmitter.cpp - Generate Clang diagnostics tables -*- C++ -*- +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-10 Thread Nikolas Klauser via cfe-commits
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) { } else { break; } + // Pack indexing + if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) && philnik777 wrote: FWIW it would be really sw

[clang] [Clang][C++26] Implement Pack Indexing (P2662R3). (PR #72644)

2024-01-10 Thread Nikolas Klauser via cfe-commits
@@ -978,6 +978,20 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) { } else { break; } + // Pack indexing + if (getLangOpts().CPlusPlus26 && Tok.is(tok::ellipsis) && philnik777 wrote: > @philnik777 This would r

[clang-tools-extra] [mlir] [libcxxabi] [compiler-rt] [clang] [flang] [llvm] [libc] [libcxx] [openmp] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

2024-01-11 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > @philnik777 I agree strongly with @Fznamznon. If `this` is not captured there > is no actual shadowing in that they do not occupy encompassing scope, and so > removing one declaration would not give you access to the other variable. I don't disagree that this is technically

[clang] 3ba8548 - [libc++][ranges] Implement ranges::transform

2022-04-05 Thread Nikolas Klauser via cfe-commits
Author: Nikolas Klauser Date: 2022-04-05T11:06:28+02:00 New Revision: 3ba8548c8e04bb301c4243887362c54bfbd4af8b URL: https://github.com/llvm/llvm-project/commit/3ba8548c8e04bb301c4243887362c54bfbd4af8b DIFF: https://github.com/llvm/llvm-project/commit/3ba8548c8e04bb301c4243887362c54bfbd4af8b.dif

[clang] [llvm] Reapply "[clang] Fix crash when declaring invalid lambda member" (PR #85427)

2024-03-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/85427 This re-applies #74110 with the crashing code disabled in C++03. I'll try to fix the new crash in it's own patch. >From 9deb45f9b175ce41698feb685d74720c2397b63e Mon Sep 17 00:00:00 2001 From: Nikolas Klauser

[clang] Reapply "[clang] Fix crash when declaring invalid lambda member" (PR #85427)

2024-03-15 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/85427 >From bfc6023d76077217fd4c82a91de6e0c08283ddbc Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 15 Mar 2024 17:28:11 +0100 Subject: [PATCH] Reapply "[clang] Fix crash when declaring invalid lambda me

[clang] Reapply "[clang] Fix crash when declaring invalid lambda member" (PR #85427)

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

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-03-17 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/73376 >From 9bd0146b3f058499b82bdb88fe5bd045c3c07caf Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 25 Nov 2023 04:00:57 +0100 Subject: [PATCH] [clang] Accept lambdas in C++03 as an extensions This is a

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-03-17 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/73376 >From 3caa29d68939fec7fcd11bc699c01a74ab1f7d2a Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 25 Nov 2023 04:00:57 +0100 Subject: [PATCH] [clang] Accept lambdas in C++03 as an extensions This is a

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-03-20 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/73376 >From 4d0e485f11fc352ff138268698f776d08c2136b1 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 25 Nov 2023 04:00:57 +0100 Subject: [PATCH] [clang] Accept lambdas in C++03 as an extensions This is a

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

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

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/86652 Fixes #54705 >From 90f88bdac3dc40635c58f3f67e29354e6a32896e Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 26 Mar 2024 12:23:24 +0100 Subject: [PATCH] [Clang] Fix __is_array returning true for zer

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > My primary question is: then what is it? > > We return true for `__is_aggregrate` (https://godbolt.org/z/67zjeo7Mj), and > an aggregate is an array or class type > (https://eel.is/c++draft/dcl.init.aggr#1). This isn't a class type... but it > is an aggregate... so it must

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > > According to the spec it's ill-formed, so I'm not sure it falls under any > > sensible category. > > It's an extension we support so it's up to us to decide what sensible is. Sure. If we end up putting it in the array category we should probably coordinate with GCC. > >

[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)

2024-03-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: The C++26 job is part of the first jobs that get run. Did you just miss it, or do you mean something else? https://github.com/llvm/llvm-project/pull/86658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)

2024-03-26 Thread Nikolas Klauser via cfe-commits
@@ -39,6 +39,9 @@ # if defined(__HAIKU__) # define _LIBUNWIND_TARGET_HAIKU 1 # endif +#if defined(__FreeBSD__) philnik777 wrote: Are these changes related? https://github.com/llvm/llvm-project/pull/86658 ___ cfe-co

[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)

2024-03-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Yes, it would be the only buildkite one (AFAIK). I don't think that would make much of a difference though. https://github.com/llvm/llvm-project/pull/86658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[libcxx] [libunwind] [DRAFT][libc++] Switch FreeBSD to C++26 (PR #86658)

2024-03-26 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 approved this pull request. LGTM with the libunwind changes removed. https://github.com/llvm/llvm-project/pull/86658 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/c

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-26 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > This doesn't leave us with good options, does it? :-( Not really. Zero-sized arrays should probably have been supported by C++ all along, but it's too late to change it now. > I think we need to consider the following things: > > * Should `Ty[0]` and `Ty[]` be handled

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > I wonder if we should be considering making zero-length arrays into a > non-conforming extension behind a flag? e.g., `-fzero-sized-arrays` and then > it does report true for `__is_array`, `__is_bounded_array`, and handles > template specializations, etc as though it were r

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-03-28 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: Another option would be to to not acknowledge zero-sized arrays in the type traits at all, just like vector types: https://godbolt.org/z/aP685vz8q. That may be the most consistent stance on this. Basically "It's non-standard and doesn't fit neatly in any of the standard categ

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > `unreachable` is morally similar to `offsetof` in that it's a macro interface > where the implementation can give better results by expanding to a builtin > than a library is likely to be able to give via a naive implementation, but > the interfaces _can_ be provided by a C

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > I can see WG21 solving this either by removing `unreachable` from `cstddef` > or by requiring `utility` to guard against the macro via implementation magic > (personally, I think `utility` should guard against it because of users > including `stddef.h` directly) and it woul

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I mean that `stddef.h` would be modified to provide it as a function instead of a macro. In C++ it would simply never be a macro. https://github.com/llvm/llvm-project/pull/86748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-03-29 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: > Re: there being observable differences between a header in C vs C++ mode, > that's already a thing. > > The definition for `isinf` in math.h is specified to be a macro in C, but > specified to be a function in C++. We're already doing `#ifdef __cplusplus` > for that (see

[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

2024-04-01 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: I'd personally be fine with deprecating it. As I said above, we use it in libc++ for padding inside `string` like ```c++ struct short_string { ; char padding[sizeof(value_type) - 1]; ; }; ``` That could be refactored relatively easily as ```c++ template struct padding_t

[clang] [Clang] Reduce the size of Decl and classes derived from it (PR #87361)

2024-04-02 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/87361 Class | Old size (in bytes) | New size (in bytes) --|-| Decl | 40

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

2024-02-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/81213 This patch also uses the new builtins in libc++. >From 6c74eb263dd889858f3f7be328d85fe354f71835 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 11 Sep 2023 04:31:02 +0200 Subject: [PATCH] [Clang] A

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

2024-02-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/81213 >From f2394044b0397cbe3bd15f96f43fbf0e50def206 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 11 Sep 2023 04:31:02 +0200 Subject: [PATCH] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r T

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

2024-02-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/81213 >From 8657d0de76373665c55b774b9cdffe9707288efc Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 11 Sep 2023 04:31:02 +0200 Subject: [PATCH] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r T

[clang] [libcxx] [clang][Sema] Add checks for validity of default ctor's class (PR #78898)

2024-02-09 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/78898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

2024-02-09 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/81213 >From b0b0072067c650e0eb1f4a556301cbc5b873935d Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 11 Sep 2023 04:31:02 +0200 Subject: [PATCH] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r T

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

2024-02-09 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/81213 >From a6ef9191b3a68e68e7dd225bfb1e802f7542ccd9 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Mon, 11 Sep 2023 04:31:02 +0200 Subject: [PATCH] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r T

[clang] [libcxx] [Clang] Add __is_invocable_r and __is_nothrow_invocable_r (PR #81213)

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

[clang] [clang] Fix behavior of `__is_trivially_relocatable(volatile int)` (PR #77092)

2024-02-12 Thread Nikolas Klauser via cfe-commits
philnik777 wrote: This isn't ABI breaking for us currently (at least in a non-benign way). We only use it to optimize `vector` growing currently, and just define it to `is_trivially_copyable` if `__is_trivially_relocatable` isn't available. https://github.com/llvm/llvm-project/pull/77092 _

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2024-03-07 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/74110 >From 563f86bddc0ec59b63c6aeffee2342f027c09119 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 1 Dec 2023 18:16:36 +0100 Subject: [PATCH 1/2] [clang] Fix crash when declaring invalid lambda member -

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

2024-03-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/74110 >From 563f86bddc0ec59b63c6aeffee2342f027c09119 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Fri, 1 Dec 2023 18:16:36 +0100 Subject: [PATCH 1/2] [clang] Fix crash when declaring invalid lambda member -

[clang] [clang] Fix crash when declaring invalid lambda member (PR #74110)

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

[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

2024-03-08 Thread Nikolas Klauser via cfe-commits
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/73376 >From 305599596dd5914747687af23a105d2968546ca1 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Sat, 25 Nov 2023 04:00:57 +0100 Subject: [PATCH] [clang] Accept lambdas in C++03 as an extensions This is a

  1   2   3   4   5   6   >