[clang] [libcxx] [libc++][modules] Rewrite the modulemap to have fewer top-level modules (PR #110501)

2024-09-30 Thread A. Jiang via cfe-commits
@@ -1,2125 +1,2235 @@ -// Main C++ standard library interfaces -module std_algorithm [system] { - header "algorithm" - export * -} -module std_any [system] { - header "any" - export * -} -module std_array [system] { - header "array" - export * -} -module std_atomic [system]

[clang] Nameof operator (PR #104777)

2024-08-19 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: BTW, the PR description perfectly ignored what will be got if the enum value matches no enumerator or more than one enumerators. https://github.com/llvm/llvm-project/pull/104777 ___ cfe-commits mailing list cfe-commits@lists.llv

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

2024-07-25 Thread A. Jiang via cfe-commits
@@ -1511,6 +1511,43 @@ Attributes (N2335) C2 ``#embed`` (N3017) C23 C89, C++ ===

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2024-06-22 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: @Endilll I think it's ready now. Sorry for late replying again. https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2024-06-22 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From c38259bd70993a96a35ce4f94790e420847786e2 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Sun, 23 Jun 2024 01:39:42 +0800 Subject: [PATCH] [Docs][Clang] DR status for C++23-era papers in cxx_status.

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2024-06-22 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-13 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/95474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-13 Thread A. Jiang via cfe-commits
@@ -3300,6 +3308,11 @@ static bool HandleLValueComplexElement(EvalInfo &Info, const Expr *E, static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Versio

[clang] [Clang] Implement P2280R4 Using unknown pointers and references in constant expressions (PR #95474)

2024-06-13 Thread A. Jiang via cfe-commits
@@ -1961,7 +1961,8 @@ namespace ConstexprConstructorRecovery { namespace Lifetime { void f() { -constexpr int &n = n; // expected-error {{constant expression}} expected-note {{use of reference outside its lifetime}} expected-warning {{not yet bound to a value}} +co

[clang] [clang] Implement a bitwise_copyable builtin type trait. (PR #86512)

2024-06-05 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: IIUC this intrinsic is unrelated to assignment operators. Do you have any plan for `__is_bitwise_assignable`, which should determine whether the assignment operator equivalently copies the value representation, possibly modulo the vptrs? ```C++ struct Cat {}; // bitwise

[clang] [Clang][C++20] Implement constexpr std::bit_cast for bit-fields (PR #74775)

2024-05-21 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: This PR should fix #54018. https://github.com/llvm/llvm-project/pull/74775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-29 Thread A. Jiang via cfe-commits
@@ -0,0 +1,57 @@ +// RUN: %clang_cc1 -DWIN -verify -std=c++23 -fsyntax-only %s +// RUN: %clang_cc1 -verify -std=c++23 -fsyntax-only %s + +// expected-no-diagnostics + + +#ifdef WIN +#define INFINITY ((float)(1e+300 * 1e+300)) +#define NAN (-(float)(INFINITY * 0.0F)) +#else

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-25 Thread A. Jiang via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity &Entity, << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-24 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-24 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/89942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-24 Thread A. Jiang via cfe-commits
@@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -std=c++26 -fsyntax-only -verify %s + +auto&& f1() { + return 42; // expected-error{{returning reference to local temporary object}} +} +const double& f2() { + static int x = 42; + return x; // expected-error{{returning reference to local te

[clang] [Clang] Implement C++26 P2748R5 "Disallow Binding a Returned Glvalue to a Temporary" (PR #89942)

2024-04-24 Thread A. Jiang via cfe-commits
@@ -8340,8 +8340,17 @@ void Sema::checkInitializerLifetime(const InitializedEntity &Entity, << Entity.getType()->isReferenceType() << CLE->getInitializer() << 2 << DiagRange; } else { -Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) -

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

2024-04-23 Thread A. Jiang via cfe-commits
@@ -2922,7 +2922,7 @@ static bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, // If during the evaluation of an expression, the result is not // mathematically defined [...], the behavior is undefined. // FIXME: C++ rules require us to not conform

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-09 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > But fails on Windows. This seems because of that MS UCRT's complex math functions are non-conforming. I _guess_ they could work if we write the following before including UCRT's ``. ```C #define _C_COMPLEX_T typedef double _Complex _C_double_complex; typedef float _Com

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-03-27 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > This does something both useful and correct with `-fno-strict-aliasing`. I'm not sure whether an instrinsic is even needed with `-fno-strict-aliasing`. IIUC `std::start_lifetime_as` mainly tells the compiler that the types of data in the storage can be changed (indeter

[clang] [libcxx] [libc++] Implement LWG3528 (`make_from_tuple` can perform (the equivalent of) a C-style cast) (PR #85263)

2024-03-20 Thread A. Jiang via cfe-commits
@@ -1386,9 +1386,19 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) apply(_Fn&& __f, _Tuple&& std::forward<_Tuple>(__t), typename __make_tuple_indices>>::type{})) +#if _LIBCPP_STD_VER >= 20 template inline _LIBCPP_HIDE_FROM_ABI constexpr _Tp __mak

[clang] [Clang] Update value for __cpp_implicit_move (#84216) (PR #84228)

2024-03-06 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: [This page](https://clang.llvm.org/cxx_status.html) still refers to [P2266R1](https://wg21.link/p2266r1) but the approved revision is [P2266R3](https://wg21.link/p2266r3). Should we fix the citation in this PR or another? https://github.com/llvm/llvm-project/pull/84228

[clang] [Clang] [Sema] Improve support for `__restrict`-qualified member functions (PR #83855)

2024-03-06 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: Reported 2 bugs for MSVC. (The first also affects standard cv-qualifiers.) - https://developercommunity.visualstudio.com/t/cv-qualifiers-and-__restrict-in-the-temp/10609457 - https://developercommunity.visualstudio.com/t/__restrict-on-non-static-member-function/10609449

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-25 Thread A. Jiang via cfe-commits
@@ -896,6 +896,12 @@ def Launder : Builtin { let Prototype = "void*(void*)"; } +def StartObjectLifeTime : Builtin { + let Spellings = ["__builtin_start_object_lifetime"]; frederick-vs-ja wrote: IMO if the intent of this intrinsic is to handle polymorphic c

[clang] [clang] Add __builtin_start_object_lifetime builtin. (PR #82776)

2024-02-23 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > * with `-fstrict-vtable-pointers` flag, we update the vtpr assumption > correctly (mark the load/store vptr with appropriate invariant group > intrinsics) to prevent incorrect vptr load folding; I _guess_ we want a variant of this intrinsic which doesn't affect analyza

[clang] [clang] Implement `__is_layout_compatible` (PR #81506)

2024-02-19 Thread A. Jiang via cfe-commits
@@ -1558,6 +1558,89 @@ void is_standard_layout() int t71[F(__is_standard_layout(HasEmptyIndirectBaseAsSecondUnionMember))]; } +struct CStruct2 { + int one; + int two; +}; + +struct CEmptyStruct2 {}; + +struct CppEmptyStruct2 : CStruct2 {}; +struct CppStructStandard2 : CEmp

[clang] [Clang] fix static operator()/[] call not evaluating object (PR #78356)

2024-01-19 Thread A. Jiang via cfe-commits
@@ -598,3 +600,27 @@ namespace B { } void g(B::X x) { A::f(x); } } + +namespace static_operator { +#if __cplusplus >= 201703L frederick-vs-ja wrote: > No way to modify things in a C++11/14 constexpr function (`++x` is not a > constant expression), so no way t

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2024-01-19 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: @Endilll Oh, I'm sorry for late replying. I wasn't wating for anybody and think this can be merged. https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] fix static operator()/[] call not evaluating object (PR #78356)

2024-01-16 Thread A. Jiang via cfe-commits
@@ -598,3 +600,27 @@ namespace B { } void g(B::X x) { A::f(x); } } + +namespace static_operator { +#if __cplusplus >= 201703L frederick-vs-ja wrote: Why C++17? https://github.com/llvm/llvm-project/pull/78356 ___ cfe

[clang] [Clang] fix static operator()/[] call not evaluating object (PR #78356)

2024-01-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/78356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix static operator()/[] call not evaluating object (PR #78356)

2024-01-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja commented: It seems that more things are being done #68485. Have you double checked that PR? https://github.com/llvm/llvm-project/pull/78356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-01-14 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > Should this be a SFINAE-able error before C++23? (It isn't currently) I believe this should (in C++11 and later modes). https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[libcxx] [flang] [clang] [compiler-rt] [llvm] [lldb] [clang-tools-extra] [libc] [lld] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-02 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/76447 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libcxx] [flang] [clang] [compiler-rt] [llvm] [lldb] [clang-tools-extra] [libc] [lld] [libc++][variant] P2637R3: Member `visit` (`std::variant`) (PR #76447)

2024-01-02 Thread A. Jiang via cfe-commits
@@ -1273,6 +1293,22 @@ public: __impl_.__swap(__that.__impl_); } +# if _LIBCPP_STD_VER >= 26 + // [variant.visit], visitation + + template frederick-vs-ja wrote: Would it be better to use a special tag type like this ```C++ struct __variant_visit_ba

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-11-26 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From 9ef23f11f52735976a05080227bb880af3b9cbb6 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 17 Oct 2023 10:41:18 +0800 Subject: [PATCH] [Docs][Clang] DR status in cxx_status.html --- clang/www/c

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-11-14 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From b2ec5be2a9eb80a4aeaf329ea4aed727b36501a1 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 17 Oct 2023 10:41:18 +0800 Subject: [PATCH] [Docs][Clang] DR status in cxx_status.html --- clang/www/c

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-11-07 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From 40dca93d3e1f339f3e756e54687ea5506b3d6f2e Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 17 Oct 2023 10:41:18 +0800 Subject: [PATCH] [Docs][Clang] DR status in cxx_status.html --- clang/www/c

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-25 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From 07007c384ee57a20ad1dd1b0422c93152bb7f18e Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 17 Oct 2023 10:41:18 +0800 Subject: [PATCH] [Docs][Clang] DR status in cxx_status.html --- clang/www/c

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja edited https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-16 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: @Endilll Thanks for notification! P2280 was already handled, while P2156 was previously missed. @cor3ntin I've add the DR status to P2156R1 and force-pushed. https://github.com/llvm/llvm-project/pull/68846 ___ cfe-commits mailin

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/68846 >From 00dec85aabcbd2e93fa80aed7b21f7ce02aab589 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 17 Oct 2023 10:41:18 +0800 Subject: [PATCH] [Docs][Clang] DR status in cxx_status.html --- clang/www/c

[clang] [Docs][Clang] Missing DR status for C++23-era papers in cxx_status.html (PR #68846)

2023-10-11 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/68846 I'm unsure whether [P2460R2](https://wg21.link/p2460r2) should be listed in the page. The paper seemingly requires no changes. ### References - [N4891](https://wg21.link/n4891) - [P1949R7](https://wg21

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-24 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: It seems that we should remove this block because it turns out that `ranges::clamp` needs double moves under some circumstances. https://github.com/llvm/llvm-project/blob/4c1c96e6fc0f704e9e032f87b2cd1e04bb4240dd/libcxx/test/std/algorithms/alg.sorting/alg.clamp/ranges.clamp