[clang] [clang][bytecode] Handle negative array sizes in constexpr `new` instead of asserting (PR #155737)

2025-08-27 Thread A. Jiang via cfe-commits
@@ -0,0 +1,15 @@ +// RUN: not %clang_cc1 -std=c++20 -fsyntax-only %s 2>&1 \ +// RUN: | FileCheck %s --implicit-check-not='Assertion `NumElements.isPositive()` failed' + +// In C++20, constexpr dynamic allocation is permitted *only* if valid. +// A negative element count must be

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-28 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: Looks like there're still some other false-positive cases (https://godbolt.org/z/1G9WPn9de): ```C++ constexpr bool same_address(const int &a, const int &b) { return &a == &b; } constexpr int next_element(const int &p) { return (&p)[2]; } struct Base {}; struct Derived :

[clang] [clang] Allow constexpr-unknown values pre C++23 (PR #129646)

2025-07-28 Thread A. Jiang via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/129646 >From 54c3e72e2c3b507ecf8cd65c15b9e137ba7331c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 4 Mar 2025 06:29:31 +0100 Subject

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-22 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > Can you manually backport this patch? See #150131. This is being backported manually in #149402. https://github.com/llvm/llvm-project/pull/149227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [clang] Don't warn on zero literals with -std=c2y (PR #149688)

2025-07-20 Thread A. Jiang via cfe-commits
@@ -44,7 +44,9 @@ static const void *ptr = 0o0; /* ext-warning {{octal integer literals are a C2y #endif // 0 by itself is not deprecated, of course. -int k = 0; +int k1 = 0; +long k2 = 0l; +unsigned long long k3 = 0ull; frederick-vs-ja wrote: Let's check t

[clang] [clang-tools-extra] [libcxx] [lldb] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

2025-07-18 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > > For what it’s worth, it looks like this introduces a series of `-Wformat` > > warnings when building the Linux kernel for 32-bit targets, which `typedef > > size_t` as `unsigned int` in > > [`include/linux/types.h`](https://git.kernel.org/pub/scm/linux/kernel/git/tor

[clang] [clang] Fix potential constant expression checking with constexpr-unknown. (PR #149227)

2025-07-17 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/149227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Allow constexpr-unknown values pre C++23 (PR #129646)

2025-07-16 Thread A. Jiang via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: frederick-vs-ja wrote: Now many potentially useful error messages are merely adjusted. But `-Winvalid-constexpr` misbehaves due to some constexpr-unknown changes. This was not noticed perhaps because `-Winvalid-constexpr` is off by default sinc

[clang] [clang] Allow constexpr-unknown values pre C++23 (PR #129646)

2025-07-15 Thread A. Jiang via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/129646 >From 54c3e72e2c3b507ecf8cd65c15b9e137ba7331c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 4 Mar 2025 06:29:31 +0100 Subject

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

2025-06-23 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: If we choose to be consistent with the standard wording, we might need to say "[...] templates for which neither explicit specialization nor partial specialization should be declared [...]", which is quite verbose. The crux seems to be that it's not clear in the standard

[clang] [Sema] Fix lifetime extension for temporaries in range-based for loops in C++23 (PR #145164)

2025-06-21 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: Could you associate this PR with the issue to fix, if any? https://github.com/llvm/llvm-project/pull/145164 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t literals be typedefs instead of built-in types (PR #143653)

2025-06-12 Thread A. Jiang via cfe-commits
@@ -320,6 +321,69 @@ bool clang::analyze_format_string::ParseUTF8InvalidSpecifier( // Methods on ArgType. //===--===// +static bool namedTypeToLengthModifierKind(QualType QT, +

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t literals be typedefs instead of built-in types (PR #143653)

2025-06-11 Thread A. Jiang via cfe-commits
@@ -6726,17 +6726,67 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { return getTypeDeclType(const_cast(Decl)); } +// Inject __size_t, __signed_size_t, and __ptrdiff_t to provide portable hints +// and diagnostics. In C and C++, expressions of type size_t

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t literals be typedefs instead of built-in types (PR #143653)

2025-06-11 Thread A. Jiang via cfe-commits
@@ -6726,17 +6726,67 @@ QualType ASTContext::getTagDeclType(const TagDecl *Decl) const { return getTypeDeclType(const_cast(Decl)); } +// Inject __size_t, __signed_size_t, and __ptrdiff_t to provide portable hints +// and diagnostics. In C and C++, expressions of type size_t

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja closed https://github.com/llvm/llvm-project/pull/142554 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > I am assuming you want to handle the libc++ changes separately? (They would > need tests/status update) Yeah. I guess it's better to separate the changes in two PRs, as combination of another library implementation with Clang will benefit slightly more quickly. https:

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/142554 >From bb6bba3dd7f58c08043a91ee56e9e219f5185668 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 3 Jun 2025 17:40:30 +0800 Subject: [PATCH] [Clang] Implement LWG3819 for `__reference_meows_from_tempo

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/142554 >From 4a98b75bcabd0f524988fbd63caedd0ecbad5810 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 3 Jun 2025 17:40:30 +0800 Subject: [PATCH] [Clang] Implement LWG3819 for `__reference_meows_from_tempo

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/142554 >From 81d30c987905ad7bdfbc6c92939a7e80a45d3a79 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 3 Jun 2025 16:46:32 +0800 Subject: [PATCH] [Clang] Implement LWG3819 for `__reference_meows_from_tempo

[clang] [Clang] Implement LWG3819 for `__reference_meows_from_temporary` (PR #142554)

2025-06-03 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/142554 Also fix use cases for function reference binding (`__reference_binds_to_temporary` is also affected despite being deprecated). Fixes #114344. Towards #105079. >From ebef8016c92db485b1efe359c576a479709

[clang] [clang][docs] Fix docs-clang-html. (PR #142387)

2025-06-02 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: I wonder whether it would be better to modify `.github/workflows/docs.yml` together. It seems that modification of some transitively included td files doesn't trigger CI for documentation. https://github.com/llvm/llvm-project/pull/142387 _

[clang] [Clang] Properly deprecate `__reference_binds_to_temporary` (PR #141909)

2025-05-29 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: It seems that we should avoid using `__reference_binds_to_temporary` in libc++'s `` first. https://github.com/llvm/llvm-project/pull/141909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [Clang] Properly deprecate `__reference_binds_to_temporary` (PR #141909)

2025-05-29 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/141909 At the time `__reference_constructs_from_temporary` got implemented, `__reference_binds_to_temporary` was mentioned as deprecated in `LanguageExtensions.rst`, but no deprecation warning was emitted. Thi

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

2025-05-26 Thread A. Jiang via cfe-commits
@@ -17,16 +17,37 @@ #include <__type_traits/is_reference.h> #include <__type_traits/remove_cvref.h> #include <__type_traits/remove_reference.h> +#include <__type_traits/type_identity.h> #include <__utility/declval.h> #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pra

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

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

[clang] [Clang][AST] Fix HandleLValueBase to deal with references (PR #140105)

2025-05-25 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > @frederick-vs-ja Were you able to create a PR for this backport? I created #140246 for this backport, and that PR is already merged. https://github.com/llvm/llvm-project/pull/140105 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang] Fix a regression introduced by #140576 (PR #140859)

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

[clang] [Clang] Set the final date for workaround for libstdc++'s `format_kind` (PR #140831)

2025-05-21 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja closed https://github.com/llvm/llvm-project/pull/140831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Set the final date for workaround for libstdc++'s `format_kind` (PR #140831)

2025-05-20 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/140831 We can use 20250520 as the final date, see the following commits. - GCC releases/gcc-15 branch: - https://gcc.gnu.org/g:fedf81ef7b98e5c9ac899b8641bb670746c51205 - https://gcc.gnu.org/g:53680c1aa92d9f7

[clang] [Clang][AST] Fix HandleLValueBase to deal with references (PR #140105)

2025-05-16 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: /cherry-pick 136f2ba2a7bca015ef831c91fb0db5e5e31b7632 https://github.com/llvm/llvm-project/pull/140105 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Fix HandleLValueBase to deal with references (PR #140105)

2025-05-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/140105 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Handle invalid variable template specialization whose type depends on itself (PR #134522)

2025-05-09 Thread A. Jiang via cfe-commits
@@ -47,3 +47,21 @@ namespace InvalidInsertPos { template<> int v; int k = v; } + +namespace GH51347 { + template + auto p = p; // expected-error {{the type of variable template specialization 'p'}} frederick-vs-ja wrote: It seems that [[temp.res.gener

[clang] [llvm] [Clang][C++23] Core language changes from P1467R9 extended floating-point types and standard names. (PR #78503)

2025-04-24 Thread A. Jiang via cfe-commits
@@ -470,8 +470,16 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI, if (LangOpts.CPlusPlus26) // FIXME: Use correct value for C++26. Builder.defineMacro("__cplusplus", "202400L"); -else if (LangOpts.CPlusPlus23) +else if (LangOpts.

[clang] [llvm] Branch1 (PR #136834)

2025-04-23 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja requested changes to this pull request. IIUC the changes should go to some test file, not `clang/lib/AST/ASTConsumer.cpp`. https://github.com/llvm/llvm-project/pull/136834 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang] Make the result type of sizeof/pointer subtraction/size_t lit… (PR #136542)

2025-04-21 Thread A. Jiang via cfe-commits
@@ -4026,10 +4026,20 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // Does it fit in size_t? if (ResultVal.isIntN(SizeTSize)) { // Does it fit in ssize_t? - if (!Literal.isUnsigned && ResultVal[SizeTSize - 1] =

[clang] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

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

[clang] [C11] Implement WG14 N1285 (temporary lifetimes) (PR #133472)

2025-04-04 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > (LMK if I've got that wrong!) Given that, how is the C11 change a breaking > change? It seems like the C99 rule was just bogus, and we should forget it > ever existed? IIUC, the "breaking change" is that in C99 a pointer value to a temporary array element never become

[clang] Minor unused variable error for sanitizer builds (PR #132372)

2025-04-04 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja approved this pull request. Thanks! I modified the PR description so GitHub can automatically associate this PR with the issue. https://github.com/llvm/llvm-project/pull/132372 ___ cfe-commits mailing list cfe-commit

[clang] [C11] Implement WG14 N1285 (temporary lifetimes) (PR #133472)

2025-04-04 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > That is unimplementable without dynamically allocating and leaking memory, > which we certainly should not do and which nobody would thank us for doing. Ah, I think [DR452](https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0452.html) (adding "Such an object n

[clang] Fixes: Can not use C99 function names as variable names in C89 (PR #129979)

2025-04-01 Thread A. Jiang via cfe-commits
@@ -135,6 +137,24 @@ bool Builtin::Context::isBuiltinFunc(llvm::StringRef FuncName) { return false; } +static bool isSymbolAvailableInC89(const llvm::StringTable &Strings, + const Builtin::Info &BuiltinInfo) { + + auto NameStr = Strings[Bu

[clang] Add more tests for _Countof (PR #133333)

2025-03-27 Thread A. Jiang via cfe-commits
@@ -81,6 +89,22 @@ void test_with_function_param(int array[12], int (*array_ptr)[12], int static_ar (void)_Countof(static_array); // expected-error {{'_Countof' requires an argument of array type; 'int *' invalid}} } +void test_func_fix_fix(int i, char (*a)[3][5], int (*x)

[clang] [C2y] Implement WG14 N3369 and N3469 (_Countof) (PR #133125)

2025-03-27 Thread A. Jiang via cfe-commits
@@ -141,6 +141,12 @@ C2y Feature Support paper also introduced octal and hexadecimal delimited escape sequences (e.g., ``"\x{12}\o{12}"``) which are also supported as an extension in older C language modes. +- Implemented `WG14 N3369

[clang] [Docs] Document freestanding requirements (PR #132232)

2025-03-25 Thread A. Jiang via cfe-commits
@@ -534,11 +534,6 @@ C23 implementation status Clang 16 - - String functions for freestanding implementations - https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2524.htm";>N2524 - No - frederick-vs-ja wrote: I found that

[clang] Minor unused variable error for sanitizer builds (PR #132372)

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

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

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

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

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

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

2025-03-22 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > It looks like this is similar to `__builtin_constant_p` - what is the > proposed behavior wrt. side effects in the evaluated expression? gcc and > clang disagree about this a lot currently: https://godbolt.org/z/rbneznT9z IIUC this intrinsic shouldn't be similar to `__

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

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

[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

2025-03-22 Thread A. Jiang via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -std=c99 -fsyntax-only -verify %s + frederick-vs-ja wrote: Would it make more sense to use `_Static_assert(__builtin_is_modifiable_lvalue(...), "")`? Also, I think it would be valuable to cover more types. N1570 6.3.2.1/1,

[clang] [Docs] Document freestanding requirements (PR #132232)

2025-03-22 Thread A. Jiang via cfe-commits
@@ -534,11 +534,6 @@ C23 implementation status Clang 16 - - String functions for freestanding implementations - https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2524.htm";>N2524 - No - frederick-vs-ja wrote: Although the

[clang] [Clang][RFC] Intrododuce a builtin to determine the structure binding size (PR #131515)

2025-03-16 Thread A. Jiang via cfe-commits
@@ -434,6 +434,36 @@ __datasizeof ``__datasizeof`` behaves like ``sizeof``, except that it returns the size of the type ignoring tail padding. +.. _builtin_structured_binding_size-doc: + +__builtin_structured_binding_size (C++) +--- +``__bu

[clang] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-15 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: Oh, there seem to be a few remaning bugs. Now I've added some FIXME comments to the most related test files. @Endilll https://github.com/llvm/llvm-project/pull/127166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-14 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127166 >From a2fc3d0550ab22e1a4273dc2debfda23df7cad6f Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 14 Feb 2025 14:03:23 +0800 Subject: [PATCH 1/4] [clang][docs] Fix DR staus for P2280R4 P2280R4 is offi

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-03-12 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja closed https://github.com/llvm/llvm-project/pull/127568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-03-12 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/4] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-03-12 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/3] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-03-12 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/3] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] Better diagnostics when assertion fails in `consteval` (PR #130458)

2025-03-12 Thread A. Jiang via cfe-commits
@@ -107,6 +107,8 @@ def err_ice_too_large : Error< "integer constant expression evaluates to value %0 that cannot be " "represented in a %1-bit %select{signed|unsigned}2 integer type">; def err_expr_not_string_literal : Error<"expression is not a string literal">; +def note

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-03-11 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/3] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-11 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > > Ideally, the C++23 behavior should also be present in C++11~20 modes. Did > > you want to add FIXME to these checks? > > Yes, this would be an improvement. I'd wait for @tbaederr's backport #129646. Once that lands, IIUC this PR will only contain pure documentation

[clang] [clang][docs] Reflect the implementation status for P2280R4 (PR #127166)

2025-03-11 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127166 >From a2fc3d0550ab22e1a4273dc2debfda23df7cad6f Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 14 Feb 2025 14:03:23 +0800 Subject: [PATCH 1/3] [clang][docs] Fix DR staus for P2280R4 P2280R4 is offi

[clang] C89 doesn't have `math.h` functions (PR #129979)

2025-03-06 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > While `log` does exist since C89 _within _, it should be allowed for > a `.c` to define `int log = 0;` because the `math.h` has not been included. > Thereby, even if `double log(double);` exists in C89 (in `math.h`), it's not > been declared in the current translation

[clang] [C2y] Implement WG14 N3411 (PR #130180)

2025-03-06 Thread A. Jiang via cfe-commits
@@ -3192,23 +3192,22 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) { DiagnosticsEngine &Diags = PP->getDiagnostics(); SourceLocation EndLoc = getSourceLocation(BufferEnd); -

[clang] C89 doesn't have `math.h` functions (PR #129979)

2025-03-05 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > Essentially all of math.h doesn't exist until `C99`: > https://en.cppreference.com/w/c/numeric/math/log You seemed to misread the page. `logf` and `logl` exist since C99, while `log` exists since C89. https://github.com/llvm/llvm-project/pull/129979 __

[clang] [clang] Reject constexpr-unknown values as constant expressions more consistently (PR #129952)

2025-03-05 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/129952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Bump `__cpp_constexpr` to `202002L` in C++20 mode (PR #129814)

2025-03-05 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja closed https://github.com/llvm/llvm-project/pull/129814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Treat constexpr-unknown value as invalid in `EvaluateAsInitializer` (PR #128409)

2025-03-04 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: /cherry-pick 27757fb87429c89a65bb5e1f619ad700928db0fd https://github.com/llvm/llvm-project/pull/128409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Treat constexpr-unknown value as invalid in `EvaluateAsInitializer` (PR #128409)

2025-03-04 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja milestoned https://github.com/llvm/llvm-project/pull/128409 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Bump `__cpp_constexpr` to `202002L` in C++20 mode (PR #129814)

2025-03-04 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/129814 Per P2493R0 and SD6, `__cpp_constexpr` of value `202002L` indicates that P1330R0 "Changing the active member of a union inside constexpr" is implemented, which is true for Clang 9 and later. Fixes #129

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-25 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-25 Thread A. Jiang via cfe-commits
@@ -69,7 +69,7 @@ "`LWG4074 `__","``compatible-joinable-ranges`` is underconstrained","2024-06 (St. Louis)","","","" "`LWG4076 `__","``concat_view`` should be freestanding","2024-06 (St. Louis)","","","" "`LWG4079

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-25 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] Implement the core language parts of P2786 - Trivial relocation (PR #127636)

2025-02-24 Thread A. Jiang via cfe-commits
@@ -1826,6 +1827,12 @@ The following type trait primitives are supported by Clang. Those traits marked functionally equivalent to copying the underlying bytes and then dropping the source object on the floor. This is true of trivial types and types which were made trivia

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-22 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/3] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-21 Thread A. Jiang via cfe-commits
@@ -0,0 +1,17 @@ +// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -verify -fms-compatibility frederick-vs-ja wrote: Added. I decided to add the positive and negative tests together. Luckily, UCRT's `` selects `__builtin_offsetof` when `_MSC_VER` isn't

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-21 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH 1/2] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-co

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-20 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

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

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

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

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-19 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-19 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-19 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-19 Thread A. Jiang via cfe-commits
@@ -0,0 +1,646 @@ +// -*- 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][CodeGen] Bail out on constexpr unknown values in ConstantEmitter (PR #127525)

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

[clang] [Clang][CodeGen] Bail out on constexpr unknown values in ConstantEmitter (PR #127525)

2025-02-18 Thread A. Jiang via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++23 %s -emit-llvm -o - | FileCheck %s frederick-vs-ja wrote: This should be tested in old modes to prevent potential regressions. P2280R4 is a defect report (ideally, against C++11/14/17/20

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-17 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From 2c9e6e45944891af54cba9648297a996bb4d8cca Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 14:03:35 +0800 Subject: [PATCH] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compat

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-17 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/127568 >From f10028a540d277e255a3c12e4ce6deb20a4165b8 Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Tue, 18 Feb 2025 13:57:30 +0800 Subject: [PATCH] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compat

[clang] [clang] Predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes (PR #127568)

2025-02-17 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja created https://github.com/llvm/llvm-project/pull/127568 This patch makes Clang predefine `_CRT_USE_BUILTIN_OFFSETOF` in MS-compatible modes. The macro can make the `offsetof` provided by MS UCRT's `` to select the `__builtin_offsetof` version, so with it Cla

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja requested changes to this pull request. https://github.com/llvm/llvm-project/pull/120920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread A. Jiang via cfe-commits
@@ -0,0 +1,70 @@ +//===--===// +// +// 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: Apac

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-17 Thread A. Jiang via cfe-commits
@@ -0,0 +1,70 @@ +//===--===// +// +// 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: Apac

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
@@ -0,0 +1,644 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja requested changes to this pull request. https://github.com/llvm/llvm-project/pull/120920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
@@ -0,0 +1,644 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
@@ -0,0 +1,638 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
https://github.com/frederick-vs-ja requested changes to this pull request. https://github.com/llvm/llvm-project/pull/120920 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-16 Thread A. Jiang via cfe-commits
@@ -0,0 +1,638 @@ +// -*- 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] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-14 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: > > > @frederick-vs-ja just follow up on this, is there anything else I need to > > > address for this PR? > > > > > > It looks like you are missing the Release Notes entry, FTM is not set, etc. > > house keeping stuff. Please check some other complete PRs for what else

[clang] [clang-tools-extra] [libcxx] [llvm] [libc++][ranges] P2542R8: Implement `views::concat` (PR #120920)

2025-02-14 Thread A. Jiang via cfe-commits
@@ -0,0 +1,638 @@ +// -*- 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][docs] Fix DR status for P2280R4 (PR #127166)

2025-02-14 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: @Endilll These checks (modified by #95474) and the newly added [`clang/test/SemaCXX/constant-expression-p2280r4.cpp`](https://github.com/llvm/llvm-project/blob/d3d2ea67585f119c99af66a343f19f237891890e/clang/test/SemaCXX/constant-expression-p2280r4.cpp) are relevant. http

  1   2   >