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

2024-05-24 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix synthesis of defaulted operator==/<=> when class has an anonymous struct member (PR #93380)

2024-05-25 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/93380 Fixes #92497 The existing implementation did try to drill into anonymous structs and compare them member by member, but it did not properly build up the member access expressions to include the anonymous str

[clang] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-05-28 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Clang only uses `Sema::isLayoutCompatible` in two places: to implement `__is_layout_compatible` and [Clang type safety checking attributes](https://clang.llvm.org/docs/AttributeReference.html#type-safety-checking), which warn if a pointer does not point to a layout compatible

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

2024-08-07 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/102044 >From 90441c251c1ec5a3b8be923ca9678c8d3d586bee Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 5 Aug 2024 20:29:12 +0100 Subject: [PATCH 1/8] [Clang][Sema] Backport P2741R3 (static_assert with user-gen

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90462 >From 96ff21d5126ebb4b9a538b8eef11f8ac9e2194c5 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 29 Apr 2024 12:27:04 +0100 Subject: [PATCH 1/4] [Clang] Reuse tail-padding for more types that are not POD

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/90462 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @hubert-reinterpretcast There were none, now I've added some: https://github.com/llvm/llvm-project/blob/cf8be1bac0eb37caaaecd47cb463ca58ee0fbe59/clang/test/Layout/itanium-padded-bit-field.cpp https://github.com/llvm/llvm-project/pull/90462 _

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90462 >From 96ff21d5126ebb4b9a538b8eef11f8ac9e2194c5 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 29 Apr 2024 12:27:04 +0100 Subject: [PATCH 1/6] [Clang] Reuse tail-padding for more types that are not POD

[clang] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90462 >From 96ff21d5126ebb4b9a538b8eef11f8ac9e2194c5 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 29 Apr 2024 12:27:04 +0100 Subject: [PATCH 1/6] [Clang] Reuse tail-padding for more types that are not POD

[clang] [libcxx] [Clang] Implement CWG2137 (list-initialization from objects of the same type) (PR #94355)

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/94355 >From ac803f979f2779da35a006988d2d42cdabbad252 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 22 Jul 2023 20:07:00 +0100 Subject: [PATCH 1/7] [SemaCXX] Implement CWG2137 (list-initialization from objec

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Is this the expected behaviour: ```c++ struct EmptyPadding : Empty { Empty e; int X; }; struct Repeated : Empty, DerivedEmpty { int X; }; // expected-warning {{inaccessible due to ambiguity}} _Static_assert(sizeof(EmptyPadding) == 8, ""); _Static_assert(sizeof(Repeated) == 8,

[clang] [clang][Interp] Fall back to dummy pointers if createGlobal() fails (PR #102464)

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: ```c++ struct Foo; struct Bar { static const Foo x; static const Foo y; }; static_assert(&Bar::x != nullptr, ""); // both-warning {{always true}} static_assert(&Bar::x != &Bar::y, ""); constexpr const Foo* xp = &Bar::x; struct Foo {}; static_assert(xp == &Bar::x); // This f

[clang] [libcxx] [Clang] Implement CWG2137 (list-initialization from objects of the same type) (PR #94355)

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Could you merge this for me please? Thanks https://github.com/llvm/llvm-project/pull/94355 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78112 >From 92f8720e3d21521b589d5291f086a2f32b87bfe0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 14 Jan 2024 19:52:31 + Subject: [PATCH 01/13] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrow

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

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @AaronBallman I think I've addressed all your comments, thanks for the review! Could you please merge this for me if there is nothing else? https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@list

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

2024-08-08 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78112 >From 92f8720e3d21521b589d5291f086a2f32b87bfe0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 14 Jan 2024 19:52:31 + Subject: [PATCH 01/14] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrow

[clang] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (PR #102619)

2024-08-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/102619 Fixes #102588 >From f47340974464dccae08980a1f8e78f0982169a58 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 9 Aug 2024 15:03:38 +0100 Subject: [PATCH] [Clang][SemaCXX] Preserve qualifiers in derived-t

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100419 >From 5d2b3fa876c00869a3964081a57ae23563d18175 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 24 Jul 2024 16:58:56 +0100 Subject: [PATCH 1/4] [Clang] Check explicit object param for defaulted relation

[clang] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in defaulted comparison operators (PR #102619)

2024-08-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/102619 >From fc436186e37ff9852269599c750f8e836aee5e99 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 9 Aug 2024 15:03:38 +0100 Subject: [PATCH] [Clang][SemaCXX] Preserve qualifiers in derived-to-base cast in

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-09 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin If everything is still good with this could you commit this for me? Thanks! https://github.com/llvm/llvm-project/pull/100419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang] [clang] Avoid triggering vtable instantiation for C++23 constexpr dtor (PR #102605)

2024-08-09 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Does this also fix #92486? https://github.com/llvm/llvm-project/pull/102605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-08-10 Thread Mital Ashok via cfe-commits
@@ -5408,7 +5408,10 @@ def note_dependent_function_template_spec_discard_reason : Note< "not a member of the enclosing %select{class template|" "namespace; did you mean to explicitly qualify the specialization?}1}0">; def warn_invalid_specialization : Warning< - "%0 shoul

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-11 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin A `void*` can be a pointer to an object but `void*` is not a pointer-to-object type. `is_object_v` -> `is_object_v || is_void_v` or `!is_function_v` https://github.com/llvm/llvm-project/pull/91895 ___ cfe-commits mailing l

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-11 Thread Mital Ashok via cfe-commits
@@ -5637,6 +5638,27 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, return false; case UTT_IsTriviallyEqualityComparable: return isTriviallyEqualityComparableType(Self, T, KeyLoc); + case UTT_IsImplicitLifetime: { +DiagnoseVLAInCXXTypeTrait(Self

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/101807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Implement `__builtin_is_implicit_lifetime()` (PR #101807)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/101807 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: The feature test macro (`__cpp_lib_is_within_lifetime`) should be defined by the standard library in ``/`` (so libc++ or libstdc++). All that changes for Clang with this patch is `__has_builtin(__builtin_is_within_lifetime)`. P2641R4 doesn't appear to be in [cxx_status](htt

[clang] [NFC] Replace bool <= bool comparison (PR #102948)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/102948 Closes #102912 >From fea4def3e66e7934718bab9d288094f7cbc5e4b7 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 12 Aug 2024 19:03:53 +0100 Subject: [PATCH] [NFC] Replace bool <= bool --- clang/lib/Sema

[clang] [NFC] Replace bool <= bool comparison (PR #102948)

2024-08-12 Thread Mital Ashok via cfe-commits
@@ -542,7 +542,7 @@ NarrowingKind StandardConversionSequence::getNarrowingKind( // If the bit-field width was dependent, it might end up being small // enough to fit in the target type (unless the target type is unsigned // and the source type is signed, in wh

[clang] [NFC] Deduplicate clang::AccessKinds to diagnostic strings (PR #102030)

2024-08-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Could you please merge this for me? Thanks https://github.com/llvm/llvm-project/pull/102030 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91895 >From 56aed689dc5825fc5bacc6dfdff58ee0eaf71f82 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 12 May 2024 19:48:24 +0100 Subject: [PATCH 01/11] [Clang] Add attribute for consteval builtins; Declare con

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Hmm. On reading https://eel.is/c++draft/meta.const.eval#4 again, it says: > *Remarks*: During the evaluation of an expression `E` as a core constant > expression, a call to this function is ill-formed unless `p` points to an > object that is usable in constant expressions or

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91895 >From 56aed689dc5825fc5bacc6dfdff58ee0eaf71f82 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 12 May 2024 19:48:24 +0100 Subject: [PATCH 01/12] [Clang] Add attribute for consteval builtins; Declare con

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
@@ -17160,3 +17184,72 @@ bool Expr::tryEvaluateStrLen(uint64_t &Result, ASTContext &Ctx) const { EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantFold); return EvaluateBuiltinStrLen(this, Result, Info); } + +namespace { +struct IsWithinLifetimeHandler { + EvalInfo &Info; +

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91895 >From 56aed689dc5825fc5bacc6dfdff58ee0eaf71f82 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 12 May 2024 19:48:24 +0100 Subject: [PATCH 01/13] [Clang] Add attribute for consteval builtins; Declare con

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/100419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100419 >From 5d2b3fa876c00869a3964081a57ae23563d18175 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 24 Jul 2024 16:58:56 +0100 Subject: [PATCH 1/5] [Clang] Check explicit object param for defaulted relation

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/100419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-15 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Yes can you do that? Thanks https://github.com/llvm/llvm-project/pull/100419 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check constraints for an explicit instantiation of a member function (PR #104438)

2024-08-15 Thread Mital Ashok via cfe-commits
@@ -5663,6 +5663,8 @@ def err_explicit_instantiation_internal_linkage : Error< def err_explicit_instantiation_not_known : Error< "explicit instantiation of %0 does not refer to a function template, " "variable template, member function, member class, or static data member">

[clang] [clang] The ms-extension __noop should return zero in a constexpr context. (PR #106849)

2024-08-31 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Could you also add tests that calling it returns zero and doesn't evaluate its arguments: ```c++ static_assert([]{ return __noop(4); }() == 0); extern int not_accessed; void not_called(); static_assert([]{ return __noop(not_accessed *= 6); }() == 0); static_assert([]{ return _

[clang] [Clang] strengthen checks for 'main' function to meet [basic.start.main] p3 requirements (PR #101853)

2024-08-16 Thread Mital Ashok via cfe-commits
@@ -12210,7 +12220,18 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, return Redeclaration; } -void Sema::CheckMain(FunctionDecl* FD, const DeclSpec& DS) { +void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) { + // [basic.start.main]p3 + //

[clang] [Clang] strengthen checks for 'main' function to meet [basic.start.main] p3 requirements (PR #101853)

2024-08-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/101853 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check explicit object parameter for defaulted operators properly (PR #100419)

2024-08-16 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @marco-antognini-sonarsource : It's before RC3 and this isn't a regression (this just never worked), and I don't think #100329 is a critical bug, so this probably shouldn't go in the 19.x branch. Especially con

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/96113 >From 453fea9fee85aef61c449761f24b0accecf03d29 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 19 Jun 2024 21:03:34 +0100 Subject: [PATCH] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit obj

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok ready_for_review https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Check constraints for an explicit instantiation of a member function (PR #104438)

2024-08-18 Thread Mital Ashok via cfe-commits
@@ -5663,6 +5663,8 @@ def err_explicit_instantiation_internal_linkage : Error< def err_explicit_instantiation_not_known : Error< "explicit instantiation of %0 does not refer to a function template, " "variable template, member function, member class, or static data member">

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/96113 >From 453fea9fee85aef61c449761f24b0accecf03d29 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 19 Jun 2024 21:03:34 +0100 Subject: [PATCH 1/2] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/94118 >From ed1c00ee4474a626965290f2d16aaaf0f4519ec9 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 1 Jun 2024 17:45:21 +0100 Subject: [PATCH 1/5] constexpr __builtin_signbit --- clang/include/clang/Basic/B

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Endilll This should be done, just needs to be merged https://github.com/llvm/llvm-project/pull/94118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] `constexpr` builtin floating point classification / comparison functions (PR #94118)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @tbaederr Thanks for fixing the build bots. The leak appears to be unrelated to these changes and happen on this line: https://github.com/llvm/llvm-project/blob/71801707e33c235656b172fa7dfb8662473a95c2/clang/test/Sema/constant-builtins-2.c#L309 It even happens with: ```c int

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/104703 See also: #94118, 71801707e33c235656b172fa7dfb8662473a95c2 >From 76735bd57b948dcbd366a80b846be38f0bf8c41e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 18 Aug 2024 14:12:51 +0100 Subject: [PATCH] [C

[clang] [Clang][test] Add bytecode interpreter tests for floating comparison functions (PR #104703)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @tbaederr I've basically just copied over the tests from the other file. There's no other quad-precision (`__float128`) tests so they were removed. Do these need to be rewritten in a C++ style? (i.e., replace the macros with template functions) https://github.com/llvm/llv

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/104704 https://cplusplus.github.io/CWG/issues/722.html nullptr passed to a variadic function now converted to void* in C++. This does not affect C23 nullptr. Also fixes -Wformat-pedantic so that it no longer warns

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This was originally part of https://reviews.llvm.org/D156054 (Previously reviewed by @AaronBallman), but there have been a lot of changes. https://github.com/llvm/llvm-project/pull/104704 ___ cfe-commits mailing list cfe-commits@lis

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-18 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,56 @@ +// RUN: %clang_cc1 -std=c++98 %s -verify -pedantic-errors +// RUN: %clang_cc1 -std=c++11 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++14 %s -verify -pedantic-errors -ast-dump | FileCheck %s +// RUN: %clang_cc1 -std=c++17 %s -

[clang] [Clang] Do not allow `[[clang::lifetimebound]]` on explicit object member functions (PR #96113)

2024-08-18 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Yes, thanks https://github.com/llvm/llvm-project/pull/96113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-19 Thread Mital Ashok via cfe-commits
@@ -19474,11 +19474,12 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum, // representable as an int. // Complain if the value is not representable in an int. - if (!isRepresentableIntegerValue(Context, EnumVal, Context.IntTy)) -

[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)

2024-08-19 Thread Mital Ashok via cfe-commits
@@ -125,6 +125,8 @@ C2y Feature Support C23 Feature Support ^^^ +- Clang now supports `N3029 `_ Improved Normal Enumerations. MitalAshok wrote: ```suggestion - Clang now supports `N

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
@@ -3760,6 +3765,9 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, if ((O->isAbsent() && !(handler.AccessKind == AK_Construct && I == N)) || (O->isIndeterminate() && !isValidIndeterminateAccess(handler.AccessKind))) { + // O

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
@@ -17264,3 +17288,76 @@ bool Expr::tryEvaluateStrLen(uint64_t &Result, ASTContext &Ctx) const { EvalInfo Info(Ctx, Status, EvalInfo::EM_ConstantFold); return EvaluateBuiltinStrLen(this, Result, Info); } + +namespace { +struct IsWithinLifetimeHandler { + EvalInfo &Info; +

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91895 >From f602189e20d15d7805b40f60b9383c83117b7d04 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 20 Aug 2024 13:23:52 +0100 Subject: [PATCH 1/3] [Clang] Add __builtin_is_within_lifetime to implement P2641

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91895 >From f602189e20d15d7805b40f60b9383c83117b7d04 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 20 Aug 2024 13:23:52 +0100 Subject: [PATCH 1/4] [Clang] Add __builtin_is_within_lifetime to implement P2641

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
@@ -169,14 +169,14 @@ def note_constexpr_this : Note< def access_kind : TextSubstitution< "%select{read of|read of|assignment to|increment of|decrement of|" "member call on|dynamic_cast of|typeid applied to|construction of|" - "destruction of}0">; + "destruction of|read o

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-20 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin I will, yes. But this probably at least needs some libc++ reviewers https://github.com/llvm/llvm-project/pull/91895 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

2024-08-20 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Yes, there's no more planned for this pr. Thanks in advance! https://github.com/llvm/llvm-project/pull/104704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-08-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78060 >From 6ed7cad5d4993603221c3d9a777463675d69643b Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 13 Jan 2024 18:03:15 + Subject: [PATCH 1/4] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/Releas

[clang] [NFC] Replace bool <= bool comparison (PR #102948)

2024-08-21 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/102948 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-08-23 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,431 @@ +// RUN: %clang_cc1 -std=c++20 -Wno-unused %s -verify=expected,cxx20 -Wno-vla-cxx-extension +// RUN: %clang_cc1 -std=c++23 -Wno-unused %s -verify=expected,sincecxx23 -Wno-vla-cxx-extension +// RUN: %clang_cc1 -std=c++26 -Wno-unused %s -verify=expected,sincecxx2

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

2024-09-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/93046 >From e1172958f43af7490b5b6e3752a9070265ad17ca Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 22 May 2024 16:01:13 +0100 Subject: [PATCH 1/4] [Clang] CWG2749: relational operators involving pointers to

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

2024-09-05 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Done! 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] [Clang] CWG2749: relational operators involving pointers to void (PR #93046)

2024-09-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/93046 >From e1172958f43af7490b5b6e3752a9070265ad17ca Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 22 May 2024 16:01:13 +0100 Subject: [PATCH 1/5] [Clang] CWG2749: relational operators involving pointers to

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Mital Ashok via cfe-commits
@@ -13,3 +15,18 @@ template struct S3 { int T::*foo; }; + +template struct Base {}; +struct +S5 // #S5 +: +Base +// expected-error@-1 {{member pointer has incomplete base type 'S5'}} MitalAshok wrote: Yes, that's just how `-fcomplete-member-pointers` works

[clang] [Clang] Fix Microsoft ABI inheritance model when member pointer is used in a base specifier (PR #91990)

2024-09-06 Thread Mital Ashok via cfe-commits
@@ -215,6 +215,14 @@ struct NewUnspecified; SingleTemplate tmpl_single; UnspecTemplate tmpl_unspec; +// Member pointers used in base specifiers force an unspecified inheritance model +struct MemPtrInBase : UnspecTemplate {}; MitalAshok wrote: I see what you

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

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

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

2024-01-19 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok converted_to_draft 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-19 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This pull request changes `E(...)` to produce the same AST as `E.operator()(...)`, which is similar to `E.f(...)` for a static member function `f`. But the linked #68485 changes this to CXXOperatorCallExpr, which is more appropriate since it is used for non-member call opera

[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-19 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/77768 >From 644ec10fc357f70ca8af94ae6544e9631021eb5e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 22 Jul 2023 20:07:00 +0100 Subject: [PATCH 1/2] [SemaCXX] Implement CWG2137 (list-initialization from objec

[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-19 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin It looks like it was in an unrelated file. I've rebased and the format check is passing now https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-01-19 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @cor3ntin Still waiting for Windows checks, but yes, could you merge if you please https://github.com/llvm/llvm-project/pull/77768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[clang] [clang][NFC] Use range-based for loops (PR #96831)

2024-06-28 Thread Mital Ashok via cfe-commits
@@ -2056,40 +2056,41 @@ void CXXRecordDecl::completeDefinition() { completeDefinition(nullptr); } +static bool hasPureVirtualFinalOverrider( +const CXXRecordDecl &RD, const CXXFinalOverriderMap *FinalOverriders) { + auto ExistsIn = [](const CXXFinalOverriderMap &FinalOv

[clang] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78060 >From 6ed7cad5d4993603221c3d9a777463675d69643b Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 13 Jan 2024 18:03:15 + Subject: [PATCH 1/3] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/Releas

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

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/78112 >From 92f8720e3d21521b589d5291f086a2f32b87bfe0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 14 Jan 2024 19:52:31 + Subject: [PATCH 1/9] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowin

[clang] [Clang] Qualified functions can't decay into pointers (PR #90353)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90353 >From b81ffefb52981276b70570f878e3e75e30a49fbb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 27 Apr 2024 19:15:00 +0100 Subject: [PATCH] [Clang] Qualified functions can't decay into pointers --- clan

[clang] [Clang] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92767 >From f87cb4c754a477515746e2ac2f8906b93ccd1fe3 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 15:58:58 +0100 Subject: [PATCH 1/5] [Clang] [C23] Fix typeof_unqual for qualified array types P

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95112 >From e53dfbc9b2c6b7f30c1378731d7de284fa99d568 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 11 Jun 2024 14:26:38 +0100 Subject: [PATCH 1/5] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

[clang] [clang-tools-extra] [Clang] Implement CWG2813: Class member access with prvalues (PR #95112)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/95112 >From e53dfbc9b2c6b7f30c1378731d7de284fa99d568 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 11 Jun 2024 14:26:38 +0100 Subject: [PATCH 1/6] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

[clang] [clang] Warn when builtin names are used outside of invocations (PR #96097)

2024-06-29 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Looks like `!__is_identifier()` is used instead of `__has_builtin` sometimes. With this patch, `__is_identifier()` is true because there's no lparen after the name In libc++: 7f302f220e7b8727ed1bf8832dcc2d87b897e527 (Pretty easy fix to replace `__has_keyword(__reference_binds

[clang] [clang][NFC] Use range-based for loops (PR #96831)

2024-06-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/96831 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Warn when builtin names are used outside of invocations (PR #96097)

2024-06-29 Thread Mital Ashok via cfe-commits
MitalAshok wrote: What if we went in the other direction? We want to deprecate `__is_pointer` as an identifier, so only make it an identifier when it is being used by libstdc++ as an identifier. libstdc++ usage looks something like: ```c++ // type template template struct __is_pointer; templat

[clang] [NFC] [Clang] Some core issues have changed status from tentatively ready -> ready / review (PR #97200)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/97200 Also classes the "ready" status similarly to "tentatively ready" in make_cxx_dr_status >From 0dea95701ca4dfca9b7d0bd889003fc35aa3017e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 10:39:

[clang] [Clang] [C23] Implement N2653: u8 strings are char8_t[] (PR #97208)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/97208 https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm Closes #97202 >From ef0072d1fc9b14f7ee657fa95f44a686b78b525a Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 12:07:54 +0100 Subje

[clang] [Clang] [C23] Implement N2653: u8 strings are char8_t[] (PR #97208)

2024-06-30 Thread Mital Ashok via cfe-commits
MitalAshok wrote: CC @AaronBallman Also the clang-format issues are intentional to fit the style of the surrounding lines https://github.com/llvm/llvm-project/pull/97208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[clang] [Clang] Warn with -Wpre-c23-compat instead of -Wpre-c++17-compat for u8 character literals in C23 (PR #97210)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/97210 None >From c6ee783243e1888074778e2cb6de05df41cc8333 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 12:55:04 +0100 Subject: [PATCH] [Clang] Warn with -Wpre-c23-compat instead of -Wpre-c++17

[clang] [NFC] [Clang] Some core issues have changed status from tentatively ready -> ready / review (PR #97200)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/97200 >From 0dea95701ca4dfca9b7d0bd889003fc35aa3017e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 10:39:15 +0100 Subject: [PATCH 1/8] [NFC] [Clang] Some core issues have changed status from ten

[clang] [NFC] [Clang] Some core issues have changed status from tentatively ready -> ready / review (PR #97200)

2024-06-30 Thread Mital Ashok via cfe-commits
@@ -111,7 +111,7 @@ struct D : N::B { #endif } // namespace cwg2857 -namespace cwg2858 { // cwg2858: 19 tentatively ready 2024-04-05 +namespace cwg2858 { // cwg2858: 19 ready 2024-04-05 MitalAshok wrote: The date of the proposed resolution did not change for

[clang] [NFC] [Clang] Some core issues have changed status from tentatively ready -> ready / review (PR #97200)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited https://github.com/llvm/llvm-project/pull/97200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] [Clang] Some core issues have changed status from tentatively ready -> ready / review (PR #97200)

2024-06-30 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/97200 >From 0dea95701ca4dfca9b7d0bd889003fc35aa3017e Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 10:39:15 +0100 Subject: [PATCH 1/9] [NFC] [Clang] Some core issues have changed status from ten

[clang] [Clang] [C23] Implement N2653: u8 strings are char8_t[] (PR #97208)

2024-07-01 Thread Mital Ashok via cfe-commits
@@ -1342,8 +1342,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI, getLockFreeValue(TI.get##Type##Width(), TI)); DEFINE_LOCK_FREE_MACRO(BOOL, Bool); DEFINE_LOCK_FREE_MACRO(CHAR, Char); -if (LangOpts.Char8) - DEFINE_LOCK_F

<    1   2   3   4   5   >