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

2024-07-24 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/9] [Clang] Implement CWG2813 --- clang/docs/ReleaseNotes.rst

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

2024-07-24 Thread Mital Ashok via cfe-commits
@@ -7617,9 +7617,13 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, // parameter is of (possibly different) type “reference to C”, // in which case the type of F1 would differ from the type of F2 // in that the type of F1 has an additional pa

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

2024-07-24 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] Initializer list on RHS of assignment (PR #100548)

2024-07-25 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/100548 This implements [CWG2768](https://cplusplus.github.io/CWG/issues/2768.html). Also fixes a bug where `x op= {v}` was treated as `x op= v` for compound assignments, which shouldn't have happened. Fixes #10052

[clang] [Clang] Initializer list on RHS of assignment (PR #100548)

2024-07-25 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100548 >From 2c1d87c025a8caa818dd275560f31d0d4f8d64b8 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Thu, 25 Jul 2024 10:56:16 +0100 Subject: [PATCH] [Clang] Initializer list on RHS of assignment --- clang/docs/

[clang] [Clang] Initializer list on RHS of assignment (PR #100548)

2024-07-25 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100548 >From 2c1d87c025a8caa818dd275560f31d0d4f8d64b8 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Thu, 25 Jul 2024 10:56:16 +0100 Subject: [PATCH 1/2] [Clang] Initializer list on RHS of assignment --- clang/d

[clang] [Clang] Initializer list on RHS of assignment (PR #100548)

2024-07-25 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100548 >From 2c1d87c025a8caa818dd275560f31d0d4f8d64b8 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Thu, 25 Jul 2024 10:56:16 +0100 Subject: [PATCH 1/2] [Clang] Initializer list on RHS of assignment --- clang/d

[clang] [Clang] Initializer list on RHS of assignment (PR #100548)

2024-07-25 Thread Mital Ashok via cfe-commits
@@ -14578,21 +14578,51 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr) { if (getLangOpts().CPlusPlus11 && isa(RHSExpr)) { -// The sy

[clang] [Clang] Initializer list on RHS of assignment (PR #100548)

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

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

2024-07-26 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/10] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrow

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

2024-07-26 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] Implement CWG2627 Bit-fields and narrowing conversions (PR #78112)

2024-07-26 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] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90387 >From 77cb28e6faf95f5beb3fadc225cb5f0525b3dfe6 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 28 Apr 2024 09:48:47 +0100 Subject: [PATCH 1/3] [clang] Implement CWG2851: floating-point conversions in co

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

2024-07-26 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 1/9] [Clang] Add attribute for consteval builtins; Declare const

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

2024-07-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: > https://cplusplus.github.io/CWG/issues/713.html This one is entirely editorial: it adds a note and edits another note. I've added a test for what the note says > https://cplusplus.github.io/CWG/issues/1417.html I'm not sure that this DR actually changes anything. It seems

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

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90353 >From d983badd09dcc227f5945f4b4759214b7b6adbf5 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 08:44:19 +0100 Subject: [PATCH 1/4] [Clang] Qualified functions can't decay into pointers ---

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

2024-07-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: I've just found out "accepted" is a resolved DR, not open: https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#Issue%20Status https://github.com/llvm/llvm-project/pull/97200 ___ cfe-commits mailing list cfe-commits@lists.llv

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

2024-07-26 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 01/13] [NFC] [Clang] Some core issues have changed status from t

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/100747 https://cplusplus.github.io/CWG/issues/713.html https://cplusplus.github.io/CWG/issues/1584.html >From 1ba0cbc3f3fc1d7982c36172ffd0e72245593e6c Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 20

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Endilll The problem with the CWG713 test in Clang 18 was with parsing the type trait (#81298), they weren't actually considered `const`: https://godbolt.org/z/snde76brE Also, I would think since the resolution is purely editorial (it just changes notes, nothing normative),

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

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90353 >From d983badd09dcc227f5945f4b4759214b7b6adbf5 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 08:44:19 +0100 Subject: [PATCH 1/5] [Clang] Qualified functions can't decay into pointers ---

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: New test compiles down to clang 3.0 (except warnings for https://cplusplus.github.io/CWG/issues/547.html) but do not compile before that because of the lack of `__is_const`/`__is_volatile` type traits. Function types with cv- qualifiers were added for Clang 2.5 in 22c40fa285

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100747 >From 1ba0cbc3f3fc1d7982c36172ffd0e72245593e6c Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 13:34:00 +0100 Subject: [PATCH 1/3] [clang][Tests][NFC] Add CWG713 test; add example from CWG1

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100747 >From 1ba0cbc3f3fc1d7982c36172ffd0e72245593e6c Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 13:34:00 +0100 Subject: [PATCH 1/3] [clang][Tests][NFC] Add CWG713 test; add example from CWG1

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: > Based on https://godbolt.org/z/n6oPdMT91, I think `3.1` is the correct > availability here, but I can be persuaded for `3.0`. The warnings are because of how the test is written, the tested behaviour ("function types are never const or volatile") is still true in Clang 3.0

[clang] [clang][Tests][NFC] Add CWG713 test; add example from CWG1584 test (PR #100747)

2024-07-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/100747 >From 1ba0cbc3f3fc1d7982c36172ffd0e72245593e6c Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 26 Jul 2024 13:34:00 +0100 Subject: [PATCH 1/4] [clang][Tests][NFC] Add CWG713 test; add example from CWG1

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

2024-07-31 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/11] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrow

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

2024-07-31 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @AaronBallman This shouldn't affect C at all since this is only about non-constant-expressions which come from a bit-field https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

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

2024-07-31 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] [llvm] [Clang] Fix definition of layout-compatible to ignore empty classes (PR #92103)

2024-07-31 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92103 >From 5908130604728b9aa9b70eeb2523d368df08e68d Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 14 May 2024 08:28:19 +0100 Subject: [PATCH 1/5] [Clang] Fix definition of layout-compatible to ignore empty

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

2024-07-31 Thread Mital Ashok via cfe-commits
MitalAshok wrote: I am also looking to cherry-pick this for Clang 19 so there won't be a difference between Clang 19 (when `__is_layout_compatible` was added) and Clang 20 https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list c

[clang] [clang][Tests][NFC] Add CWG882 test (Defining `main` as deleted) (PR #101382)

2024-07-31 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/101382 https://cplusplus.github.io/CWG/issues/882.html This was implemented for Clang 3.5 by b63b6ee9a00ef0710d899df6cfda78a1b8bd762a >From 9dcbd0779bf379bbf62bf52247ef46de82cb4877 Mon Sep 17 00:00:00 2001 From: Mi

[clang] [Clang][SemaCXX] Fix bug where unexpanded lambda captures where assumed to have size 1 (PR #101385)

2024-07-31 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/101385 Fixes #63677 >From 555373715bc2eb025d6580129cead087f7f45ed1 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 7 Jul 2023 14:31:03 +0100 Subject: [PATCH] [Clang][SemaCXX] Fix bug where unexpanded lambda c

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

2024-07-17 Thread Mital Ashok via cfe-commits
MitalAshok wrote: I have reached out to Fuschia on their discord and am still waiting for a response. I was unable to find a place to ask someone related to IBM XL what is supposed to happen (and I couldn't get the xl++ compiler to check what it does). Would be grateful if someone more knowl

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

2024-07-17 Thread Mital Ashok via cfe-commits
@@ -9015,11 +9015,20 @@ bool Sema::RequireCompleteTypeImpl(SourceLocation Loc, QualType T, if (const MemberPointerType *MPTy = T->getAs()) { if (!MPTy->getClass()->isDependentType()) { - if (getLangOpts().CompleteMemberPointers && - !MPTy->getClass()->getA

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

2024-07-18 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: It's an error for `-fcomplete-member-pointers` which is

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

2024-07-18 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: It's not for si

[clang] [SemaCXX] Make __builtin_addressof more like std::addressof (PR #78035)

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

[clang] [SemaCXX] Recognise initializer_list injected-class-name types as initializer_lists (PR #90210)

2024-04-26 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/90210 This allows the implicitly-generated deduction guide for the copy constructor to be recognised as an initializer-list constructor, allowing CTAD for std::initializer_list >From ff65636895e8bceb5b4d6497a0e9cc

[clang] [SemaCXX] Recognise initializer_list injected-class-name types as initializer_lists (PR #90210)

2024-04-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Original Differential revision: https://reviews.llvm.org/D156064 Doesn't appear that anything has changed since, just rebased the changes. https://github.com/llvm/llvm-project/pull/90210 ___ cfe-commits mailing list cfe-commits@lists

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

2024-04-26 Thread Mital Ashok via cfe-commits
@@ -1600,12 +1600,25 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo, return ExprError(Diag(TyBeginLoc, diag::err_init_for_function_type) << Ty << FullRange); - // C++17 [expr.type.conv]p2: - // If the type is cv void and the initializer

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

2024-04-26 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] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/ReleaseNot

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

2024-04-26 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] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowing co

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

2024-04-26 Thread Mital Ashok via cfe-commits
MitalAshok wrote: New version gives a pedantic warning if this is used before C++23 (and it is a substitution failure before C++23) https://github.com/llvm/llvm-project/pull/78112 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

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

2024-04-27 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/90353 Fixes #27059 Dependent function parameters, template parameters and exception declarations that have qualified function types now error instead of silently decaying into an invalid pointer type. Also fix __

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-28 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/90387 https://cplusplus.github.io/CWG/issues/2851.html The only time the target type for a converted constant expression is a floating-point type is in a NTTP, so this only affects C++20+. >From 3d56657f03ab6824bf

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-28 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90387 >From a87399f8a41bb7d9a61c2d44c75836d86c6b4c38 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 28 Apr 2024 09:48:47 +0100 Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in conver

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-28 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90387 >From 13e2943dea677daf8976ab55a673d43982ac8a4c Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 28 Apr 2024 09:48:47 +0100 Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in conver

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-28 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Waiting on #90352 because it's not on the cxx_dr_status page yet (`make_dr_status` doesn't do anything) https://github.com/llvm/llvm-project/pull/90387 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-29 Thread Mital Ashok via cfe-commits
@@ -6229,7 +6231,37 @@ static ExprResult BuildConvertedConstantExpression(Sema &S, Expr *From, if (Result.isInvalid()) return Result; - // Check for a narrowing implicit conversion. + if (SCS->Second == ICK_Floating_Conversion) { MitalAshok wrote: Be

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90387 >From 0b8176cf2171da0ce780c15131e19a24473a6989 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 28 Apr 2024 09:48:47 +0100 Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in conver

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

2024-04-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/90462 This will be done for types with over-large bitfields and potentially-overlapping ([[no_unique_address]]) members Compatible with old Clang 18 semantics with -fclang-abi-compat Fixes #50766 >From 96ff21d512

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

2024-04-29 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Some choices I've made: * Removed `TargetCXXABI::TailPaddingUseRules` and `TargetCXXABI::getTailPaddingUseRules()`. Now there are 5 distinct tail padding rules (7 if you count tail padding rules that change with `-fclang-abi-compat=18.0`), and it was only used in the `mustS

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-29 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90387 >From 77cb28e6faf95f5beb3fadc225cb5f0525b3dfe6 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 28 Apr 2024 09:48:47 +0100 Subject: [PATCH] [clang] Implement CWG2851: floating-point conversions in conver

[clang] [clang] Implement CWG2851: floating-point conversions in converted constant expressions (PR #90387)

2024-04-30 Thread Mital Ashok via cfe-commits
@@ -67,6 +68,69 @@ void B::g() requires true; } // namespace cwg2847 +namespace cwg2851 { // cwg2851: 19 + +#if __cplusplus >= 202002L +template struct Val { static constexpr T value = v; }; + + +// Floating-point promotions + +static_assert(Val::value == 0.0L); +static_asser

[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] [C23] Implement N2653: u8 strings are char8_t[] (PR #97208)

2024-07-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/97208 >From ef0072d1fc9b14f7ee657fa95f44a686b78b525a Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 12:07:54 +0100 Subject: [PATCH 1/7] [Clang] [C23] Implement N2653: u8 strings are char8_t[] ---

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

2024-07-09 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -verify=c23 -std=c23 %s +// RUN: %clang_cc1 -verify=c17 -std=c17 %s MitalAshok wrote: That still seems to fail on the CI: ``` TEST 'Clang :: C/C23/n2653.c' FAILED Exit Code: 1 Comman

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

2024-07-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/97208 >From ef0072d1fc9b14f7ee657fa95f44a686b78b525a Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 12:07:54 +0100 Subject: [PATCH 1/8] [Clang] [C23] Implement N2653: u8 strings are char8_t[] ---

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

2024-07-09 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/97208 >From ef0072d1fc9b14f7ee657fa95f44a686b78b525a Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 30 Jun 2024 12:07:54 +0100 Subject: [PATCH 1/9] [Clang] [C23] Implement N2653: u8 strings are char8_t[] ---

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

2024-07-09 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -verify=c23 -std=c23 %s +// RUN: %clang_cc1 -verify=c17 -std=c17 %s MitalAshok wrote: I think I ran the wrong tests then misread some `-E` output... Should be fixed now (`__STDC_VERSION__ > 202311L` -> `__STDC_VERSION__ >= 20

[clang] [Clang] Warn on backslash-newline-EOF (PR #97585)

2024-07-11 Thread Mital Ashok via cfe-commits
@@ -3165,7 +3165,17 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { // C99 5.1.1.2p2: If the file is non-empty and didn't end in a newline, issue // a pedwarn. - if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) { + if (CurPtr !=

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

2024-07-12 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] [C23] Fix typeof_unqual for qualified array types (PR #92767)

2024-07-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @AaronBallman was there anything else that needed to be done? Just did a merge because ReleaseNotes was edited but this should be fine https://github.com/llvm/llvm-project/pull/92767 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

2024-05-01 Thread Mital Ashok via cfe-commits
@@ -2280,18 +2294,18 @@ class FunctionDecl : public DeclaratorDecl, /// Returns whether this specific declaration of the function has a body. bool doesThisDeclarationHaveABody() const { -return (!FunctionDeclBits.HasDefaultedFunctionInfo && Body) || +return (!Funct

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

2024-05-01 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/90725 Fixes #90605 >From 0793795ba7d5d5974b1403cd6ead0221fc20c5bb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 1 May 2024 12:45:54 +0100 Subject: [PATCH] [Clang] Ensure "=default"ed function can be deleted

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

2024-05-01 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90725 >From 0793795ba7d5d5974b1403cd6ead0221fc20c5bb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 1 May 2024 12:45:54 +0100 Subject: [PATCH 1/2] [Clang] Ensure "=default"ed function can be deleted when use

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

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

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

2024-05-01 Thread Mital Ashok via cfe-commits
@@ -9767,7 +9767,9 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, return false; CXXRecordDecl *RD = MD->getParent(); assert(!RD->isDependentType() && "do deletion after instantiation"); - if (!LangOpts.CPlusPlus || (!LangOpts.CPlusPlus11 && !RD->isLambda())

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

2024-05-01 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90725 >From 0793795ba7d5d5974b1403cd6ead0221fc20c5bb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 1 May 2024 12:45:54 +0100 Subject: [PATCH 1/2] [Clang] Ensure "=default"ed function can be deleted when use

[clang] [Clang] Ensure "=default"ed function can be deleted when used as an extension in C++03 (PR #90725)

2024-05-01 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90725 >From 0793795ba7d5d5974b1403cd6ead0221fc20c5bb Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 1 May 2024 12:45:54 +0100 Subject: [PATCH 1/3] [Clang] Ensure "=default"ed function can be deleted when use

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-05-01 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This is [CWG2084](https://wg21.link/CWG2084). Could you also add some tests to CXX/drs/ so that www/cxx_dr_status.html can be updated? https://github.com/llvm/llvm-project/pull/82407 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [Clang][Sema] Fix incorrect rejection default construction of union with nontrivial member (PR #82407)

2024-05-01 Thread Mital Ashok via cfe-commits
@@ -9442,9 +9442,21 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall( int DiagKind = -1; - if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted) -DiagKind = !Decl ? 0 : 1; - else if (SMOR.getKind() == Sema::SpecialMemberOverloadRe

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/91070 Incomplete types are assumed to need the llvm.launder.invariant.group intrinsic Fixes #90949 >From 21d9f27692b2a2fa9ac99f4644109e62e3730133 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From fe8c0dc5f7beacae7b1494a5987c3674dbd330d3 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91070 >From 11ad517cede0902945c0b7eba0e7f1ff93f08ea0 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sat, 4 May 2024 17:31:31 +0100 Subject: [PATCH] [Clang] No longer require complete types with __builtin_launder

[clang] [Clang] No longer require complete types with __builtin_launder (PR #91070)

2024-05-10 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Here's one scenario where it could make a difference in codegen : ```c++ // Header struct X; extern X x; void f(X&); inline void g() { f(x); } inline void h() { f(*__builtin_launder(__builtin_addressof(x))); } // Source struct X {

[clang] [analyzer] Allow recursive functions to be trivial. (PR #91876)

2024-05-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: You should add a test for mutually recursive functions. I suspect something like this doesn't work: ```c++ int non_trivial(); int f(bool b) { return g(!b) + non_trivial(); } int g(bool b) { return b ? f(b) : 1; } getFieldTrivial().f(true); // expected-warning

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

2024-05-12 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/91894 Also support redeclaring now-constexpr builtins without constexpr >From 56aed689dc5825fc5bacc6dfdff58ee0eaf71f82 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 12 May 2024 19:48:24 +0100 Subject: [PATC

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

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

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

2024-05-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This is on top of #91894 [P2641R4](https://wg21.link/P2641R4) Currently, this doesn't strictly check "whose complete object's lifetime began within `E`". A bunch of the static_asserts I have for objects under construction should be ill-formed instead of false, but some of th

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

2024-05-12 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Currently, GCC's behaviour for builtin function redeclarations is to just ignore `constexpr`: . This is slightly stricter, allowing non-`constexpr` redeclarations for `constexpr` builtins but still disallowing `constexpr` declarations for non-

[clang] [Clang] Ensure ``if consteval`` consititute an immediate function context (PR #91939)

2024-05-13 Thread Mital Ashok via cfe-commits
@@ -7964,6 +7964,15 @@ TreeTransform::TransformIfStmt(IfStmt *S) { // Transform the "then" branch. StmtResult Then; if (!ConstexprConditionValue || *ConstexprConditionValue) { +Sema::ExpressionEvaluationContext Context = +S->isNonNegatedConsteval() +

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

2024-05-13 Thread Mital Ashok via cfe-commits
@@ -14,13 +14,18 @@ void __builtin_va_copy(double d); // expected-error@+2 {{cannot redeclare builtin function '__builtin_va_end'}} // expected-note@+1 {{'__builtin_va_end' is a builtin with type}} void __builtin_va_end(__builtin_va_list); -// RUN: %clang_cc1 %s -fsyntax-only -

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

2024-05-13 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/91990 Fix `CXXRecordDecl::isParsingBaseSpecifiers` so that it is true while parsing base specifiers instead of directly after they have been parsed. -fcomplete-member-pointers now issues a diagnostic when a member

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

2024-05-13 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Example of the incompatibility: https://godbolt.org/z/Mn1T57WGb ```c++ struct unspecified_inheritance; template struct X { static_assert(I == sizeof(int unspecified_inheritance::*), ""); }; struct Y : X {}; ``` Currently, the `sizeof(int Y::*)` locks down the inheritance

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

2024-05-13 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/91990 >From 5dc9193af0d98335a87e93ad70d945dbc0ffce79 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 13 May 2024 16:59:06 +0100 Subject: [PATCH] [Clang] Fix Microsoft ABI inheritance model when member pointer

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

2024-05-14 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/92103 Also changes the behaviour of `__builtin_is_layout_compatible` None of the historic nor the current definition of layout-compatible classes mention anything about base classes (other than implicitly through b

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

2024-05-14 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92103 >From 74e133215e7ba9049fb021eb9bbb130347496503 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 14 May 2024 08:28:19 +0100 Subject: [PATCH] [Clang] Fix definition of layout-compatible to ignore empty cla

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

2024-05-14 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92103 >From 5908130604728b9aa9b70eeb2523d368df08e68d Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 14 May 2024 08:28:19 +0100 Subject: [PATCH] [Clang] Fix definition of layout-compatible to ignore empty cla

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

2024-05-14 Thread Mital Ashok via cfe-commits
@@ -67,6 +63,27 @@ void B::g() requires true; } // namespace cwg2847 +namespace cwg2857 { // cwg2857: 2.7 +struct A {}; +struct B { + int operator+(A); +}; +template +struct D; + +void f(A* a, D* d) { + *d + *a; MitalAshok wrote: This wouldn't be an ADL l

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

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

[clang] [clang] Add tests for CWG issues regarding completeness of types (PR #92113)

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

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

2024-05-14 Thread Mital Ashok via cfe-commits
@@ -14,13 +14,18 @@ void __builtin_va_copy(double d); // expected-error@+2 {{cannot redeclare builtin function '__builtin_va_end'}} // expected-note@+1 {{'__builtin_va_end' is a builtin with type}} void __builtin_va_end(__builtin_va_list); -// RUN: %clang_cc1 %s -fsyntax-only -

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

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

[clang] [Clang] Add attribute for consteval builtins; Declare constexpr builtins as constexpr in C++ (PR #91894)

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

[clang] [Clang] Add attribute for consteval builtin functions (PR #91894)

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

[clang] [Clang] Add attribute for consteval builtin functions (PR #91894)

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

[clang] [Clang] Add attribute for consteval builtin functions (PR #91894)

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

[clang] [Clang][Sema] Fix last argument not being used when comparing function template specializations when one has an explicit object argument (PR #92263)

2024-05-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/92263 Fixes #92188 >From 6496dbfc8100812c8d3ea5a668af0593b532e4fe Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 15 May 2024 14:23:17 +0100 Subject: [PATCH] [Clang][Sema] Fix last argument not being used whe

<    1   2   3   4   5   >