[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
MitalAshok wrote: See also: #83279 https://github.com/llvm/llvm-project/pull/92263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[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 updated https://github.com/llvm/llvm-project/pull/92263 >From 6496dbfc8100812c8d3ea5a668af0593b532e4fe Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 15 May 2024 14:23:17 +0100 Subject: [PATCH 1/2] [Clang][Sema] Fix last argument not being used when compari

[clang] [Clang] [Sema] Fix some assertions not looking through type sugar (PR #92299)

2024-05-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/92299 Fixes #92284 >From 98d773a3a0a2faa407fddb20a63db7bf01890a98 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 15 May 2024 18:50:14 +0100 Subject: [PATCH] [Clang] [Sema] Fix some assertions not looking thr

[clang] [Clang] Fix some assertions not looking through type sugar (PR #92299)

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

[clang] [Clang] [Sema] Fix some assertions not looking through type sugar (PR #92299)

2024-05-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92299 >From b6cb1c53a20637255bf869617b60155bfb636c60 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 15 May 2024 18:50:14 +0100 Subject: [PATCH] [Clang] Fix some assertions not looking through type sugar Fixe

[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-16 Thread Mital Ashok via cfe-commits
@@ -5591,7 +5592,11 @@ FunctionTemplateDecl *Sema::getMoreSpecializedTemplate( IsRValRef1); Args2.push_back(Obj2Ty); } -size_t NumComparedArguments = NumCallArguments1 + ShouldConvert1; +size_t NumComparedArguments

[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-17 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92263 >From 6496dbfc8100812c8d3ea5a668af0593b532e4fe Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 15 May 2024 14:23:17 +0100 Subject: [PATCH 1/2] [Clang][Sema] Fix last argument not being used when compari

[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-17 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Sirraide Oh I didn't see the conflict, thanks. It should be fine now? https://github.com/llvm/llvm-project/pull/92263 ___ 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-05-20 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/8] [Clang] Add attribute for consteval builtins; Declare const

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

2024-05-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok edited 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-commits

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

2024-05-20 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] Add __builtin_is_within_lifetime to implement P2641R4's std::is_within_lifetime (PR #91895)

2024-05-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok ready_for_review 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-commits

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

2024-05-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/92767 Properly remove qualifiers for both the element type and the array type Fixes #92667 >From f87cb4c754a477515746e2ac2f8906b93ccd1fe3 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 15:58:58

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

2024-05-20 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/2] [Clang] [C23] Fix typeof_unqual for qualified array types P

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

2024-05-20 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/3] [Clang] [C23] Fix typeof_unqual for qualified array types P

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-20 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/92814 A new warning -Wdelete-array is issued for the now-accepted delete of an array, which becomes a pointer to the first element after an array-to-pointer conversion. The GNU extension of deleting a void pointer

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-20 Thread Mital Ashok via cfe-commits
MitalAshok wrote: The array-to-pointer conversion *is* necessary, even if it's impractical to use: https://eel.is/c++draft/expr.delete#1.sentence-5 > Otherwise, it shall be a prvalue of pointer to object type. https://eel.is/c++draft/basic.lval#6 > Whenever a glvalue appears as an operand of

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

2024-05-21 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @dwblaikie This patch will bring Clang in line with GCC and MSVC: https://godbolt.org/z/nj715zbsW https://github.com/llvm/llvm-project/pull/92103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

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

2024-05-21 Thread Mital Ashok via cfe-commits
@@ -561,6 +561,42 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { data().StructuralIfLiteral = false; } +const CXXRecordDecl *CXXRecordDecl::getStandardLayoutBaseWithFields() const { +#ifndef NDEBUG + { +assert( +isStandardLayout() && +

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

2024-05-21 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/3] [Clang] Fix definition of layout-compatible to ignore empty

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
@@ -1230,11 +1230,11 @@ namespace cwg598 { // cwg598: yes int &t = h(N::i); } -namespace cwg599 { // cwg599: partial +namespace cwg599 { // cwg599: 19 typedef int Fn(); struct S { operator void*(); }; struct T { operator Fn*(); }; - struct U { operator int*(); oper

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
@@ -1245,12 +1245,7 @@ namespace cwg599 { // cwg599: partial // expected-error@-1 {{cannot delete expression with pointer-to-'void' type 'void *'}} delete t; // expected-error@-1 {{cannot delete expression of type 'T'}} -// FIXME: This is valid, but is rejected

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
MitalAshok wrote: I've also found and fixed a related bug where types were compared with `==` not `hasSameType`, leading to two conversion operators appearing to be different when they are the same and Clang not compiling valid code: https://godbolt.org/z/nY7svGKn8 https://github.com/llvm/llv

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92814 >From 43e9f8fe5cdb19c0f57a00b352592e56e470ffe7 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 20:18:48 +0100 Subject: [PATCH 1/2] [Clang] Change how the argument of a delete expression is c

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92814 >From 43e9f8fe5cdb19c0f57a00b352592e56e470ffe7 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 20:18:48 +0100 Subject: [PATCH 1/2] [Clang] Change how the argument of a delete expression is c

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-21 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92814 >From 43e9f8fe5cdb19c0f57a00b352592e56e470ffe7 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 20:18:48 +0100 Subject: [PATCH 1/3] [Clang] Change how the argument of a delete expression is c

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

2024-05-21 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/4] [Clang] [C23] Fix typeof_unqual for qualified array types P

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

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

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

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

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

2024-05-21 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/2] [SemaCXX] Implement CWG2351 `void{}` --- clang/docs/Releas

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

2024-05-21 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @zygoloid The commit message was a bit outdated, it now takes the void type from `T` instead of the initializer list (this also preserves extra info like if it came from a typedef) I've also changed it to `CK_ToVoid` https://github.com/llvm/llvm-project/pull/78060 __

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

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

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

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

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

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

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

2024-05-21 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/90353 >From c6cd95926b0de2687f56a4966ebb5babd30ba33f 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 Fixes #27

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

2024-05-22 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] [Clang] Reuse tail-padding for more types that are not POD for

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

2024-05-22 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-05-22 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] CWG2749: relational operators involving pointers to void (PR #93046)

2024-05-22 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/93046 This DR's effects are backported to C++98. Does not affect C where integral constant expressions cannot involve pointers. >From aa5e7f71efdfcdea902ac881fd8db6b7c4f4538d Mon Sep 17 00:00:00 2001 From: Mital As

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

2024-05-22 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] [Clang] CWG2749: relational operators involving pointers to voi

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

2024-05-22 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok 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] [Clang] Reuse tail-padding for more types that are not POD for the purpose of layout (PR #90462)

2024-05-22 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/2] [Clang] Reuse tail-padding for more types that are not POD

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

2024-05-22 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/2] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowin

[clang] [Clang] Change how the argument of a delete expression is converted (PR #92814)

2024-05-22 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/92814 >From 43e9f8fe5cdb19c0f57a00b352592e56e470ffe7 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 20 May 2024 20:18:48 +0100 Subject: [PATCH 1/3] [Clang] Change how the argument of a delete expression is c

[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 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/3] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowin

[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 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/3] [clang] [SemaCXX] Implement CWG2627 Bit-fields and narrowin

[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] [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
MitalAshok wrote: Revived from https://reviews.llvm.org/D154716 This probably needs a fresh review, I've just rebased onto main. The problem still exists on main: https://godbolt.org/z/vPTb4qEnd CC @cor3ntin @shafik (as people who reviewed on the phabricator) https://github.com/llvm/llvm-proj

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

2024-07-31 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101382 >From 9dcbd0779bf379bbf62bf52247ef46de82cb4877 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Wed, 31 Jul 2024 19:18:09 +0100 Subject: [PATCH 1/2] [clang][Tests][NFC] Add CWG882 test (Defining `main` as de

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-08-01 Thread Mital Ashok via cfe-commits
MitalAshok wrote: I think the issue is here somewhere: https://github.com/llvm/llvm-project/blob/7088a5ed880f29129ec844c66068e8cb61ca98bf/clang/lib/Sema/SemaDecl.cpp#L8753-L8764 An incomplete struct passes `CheckC23ConstexprVarType` (which it should, incomplete types should fail later) so it g

[clang] [Clang] prevent assertion failure by avoiding casts on type declarations that require complete types (PR #101426)

2024-08-01 Thread Mital Ashok via cfe-commits
@@ -9267,14 +9267,14 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T, if (!RT) return true; - const CXXRecordDecl *RD = cast(RT->getDecl()); - // A partially-defined class type can't be a literal type, because a literal // class type must have a t

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

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

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

2024-08-01 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/6] [Clang] Fix definition of layout-compatible to ignore empty

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

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

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

2024-08-01 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Endilll It should be good to merge after the last quick commit (which just ran cxx_make_dr_status). Could you please merge this for me? Thanks! https://github.com/llvm/llvm-project/pull/97200 ___ cfe-commits mailing list cfe-commits

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

2024-08-01 Thread Mital Ashok via cfe-commits
MitalAshok wrote: A list of places this could be used: https://eel.is/c++draft/cmp.result#1 https://eel.is/c++draft/meta.rqmts#4 https://eel.is/c++draft/execpol.type#3 https://eel.is/c++draft/format.arg#2 https://eel.is/c++draft/range.adaptor.object#5 https://eel.is/c++draft/coro.generator.class

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

2024-08-01 Thread Mital Ashok via cfe-commits
@@ -975,6 +975,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``. }]; } +def DiagnoseSpecializationsDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +``clang::diagnose_specializations`` can be appied to class templates which +should

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

2024-08-01 Thread Mital Ashok via cfe-commits
@@ -975,6 +975,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``. }]; } +def DiagnoseSpecializationsDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ +``clang::diagnose_specializations`` can be appied to class templates which +should

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

2024-08-01 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @Endilll @AaronBallman Removed the release note and the tests have passed again. Would appreciate if someone else could start the backport process afterwards since I don't know how to do it. https://github.com/llvm/llvm-project/pull/92103

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

2024-08-01 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] [Clang] Implement CWG2351 `void{}` (PR #78060)

2024-08-02 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Ping @cor3ntin (This missed Clang 19 but could you merge it for Clang 20?) https://github.com/llvm/llvm-project/pull/78060 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[clang] [Clang] Support for LibBuiltins with placeholder return types (PR #101702)

2024-08-02 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/101702 Make sure that the functions are instantiated to deduce the return type. Fixes #101614 Allow `BuiltinFnTy` in `BuildDecltypeType` (these are wrapped in a `DeclRefExpr` that has the actual type). Fixes #1016

[clang] [Clang] Support for LibBuiltins with placeholder return types (PR #101702)

2024-08-02 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101702 >From 4a7bda13cf7804db1ffce81d3aac77a192585e07 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Fri, 2 Aug 2024 16:27:54 +0100 Subject: [PATCH] [Clang] Support for LibBuiltins with placeholder return types -

[clang] [Clang] Allow LibBuiltins with placeholder return types to be called (PR #101702)

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

[clang] [Clang] Allow LibBuiltins with placeholder return types to be called (PR #101702)

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

[clang] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute (PR #101871)

2024-08-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/101871 This attribute applies to `GCCAsmStmt` statements or functions. If a function is declared with this, it is effectively the default for all `GCCAsmStmt`s contained in the function. Takes one string argument:

[clang] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute (PR #101871)

2024-08-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101871 >From 321934e1fc59908cbcd7fac4992e2b85357899d4 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 4 Aug 2024 09:09:19 +0100 Subject: [PATCH] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute --- cl

[clang] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute (PR #101871)

2024-08-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101871 >From 7f8c82071c9cc324acd7f2a79539392e74838545 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 4 Aug 2024 09:09:19 +0100 Subject: [PATCH] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute --- cl

[clang] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute (PR #101871)

2024-08-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101871 >From 6dd98b5c255580909a9f38baa1bbdc257e5d60d2 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 4 Aug 2024 09:09:19 +0100 Subject: [PATCH] [Clang][CodeGen] Add `[[clang::asm_dialect]]` attribute --- cl

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

2024-08-04 Thread Mital Ashok via cfe-commits
@@ -990,6 +990,9 @@ def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< "referring to 'main' within an expression is a Clang extension">, InGroup; +def err_invalid_linkage_

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

2024-08-04 Thread Mital Ashok via cfe-commits
@@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic-errors %s + +namespace c { + extern "C" void main(); // expected-error {{invalid linkage specification 'extern "C"'}} +} +extern "C" { + int main(); // expected-error {{invalid linkage specification 'extern "C

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

2024-08-04 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-04 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-04 Thread Mital Ashok via cfe-commits
@@ -86,6 +86,9 @@ C++23 Feature Support C++2c Feature Support ^ +- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports MitalAshok wrote: Why is this called `__builtin_is_implicit_lifetime` instead of `__is_implicit_lifetime`

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

2024-08-04 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][SemaCXX] Fix bug where unexpanded lambda captures where assumed to have size 1 (PR #101385)

2024-08-04 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/101385 >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 captures where

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

2024-08-05 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] strengthen checks for 'main' function to meet [basic.start.main] p2 requirements (PR #101853)

2024-08-05 Thread Mital Ashok via cfe-commits
@@ -12370,6 +12379,17 @@ void Sema::CheckMain(FunctionDecl* FD, const DeclSpec& DS) { } } +bool Sema::CheckLinkageSpecification(DeclContext *DC, Decl *D) { + // [basic.start.main] p2 + // The main function shall not be declared with a linkage-specification. + if (DC->i

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

2024-08-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok requested changes to this pull request. You can put some of the tests in `clang/test/CXX/basic/basic.start/basic.start.main/p3.cpp` You lost the check for `extern "C++" int main() {}` at global scope. To recap: ```c++ // These are disallowed by [basic.start.main]p

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

2024-08-05 Thread Mital Ashok via cfe-commits
@@ -7353,6 +7353,15 @@ void emitReadOnlyPlacementAttrWarning(Sema &S, const VarDecl *VD) { } } +static bool isMainVar(DeclarationName Name, VarDecl *VD) { + if (Name.getAsIdentifierInfo() && Name.getAsIdentifierInfo()->isStr("main") && + !VD->getDescribedVarTemplate(

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

2024-08-05 Thread Mital Ashok via cfe-commits
@@ -3292,11 +3292,9 @@ bool FunctionDecl::isImmediateFunction() const { } bool FunctionDecl::isMain() const { - const TranslationUnitDecl *tunit = -dyn_cast(getDeclContext()->getRedeclContext()); - return tunit && - !tunit->getASTContext().getLangOpts().Freestand

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

2024-08-05 Thread Mital Ashok via cfe-commits
@@ -990,6 +990,8 @@ def warn_main_redefined : Warning<"variable named 'main' with external linkage " "has undefined behavior">, InGroup; def ext_main_used : Extension< "referring to 'main' within an expression is a Clang extension">, InGroup; +def err_main_invalid_lin

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

2024-08-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/102030 None >From 2763f4618c654decf262493cb90cc8b1352b1599 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 5 Aug 2024 19:05:59 +0100 Subject: [PATCH] [NFC] Deduplicate clang::AccessKinds to diagnostic strings

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

2024-08-05 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Split off from #91895 CC @cor3ntin 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-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok converted_to_draft 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-commits

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

2024-08-05 Thread Mital Ashok via cfe-commits
@@ -1832,6 +1832,33 @@ static ExprResult BuiltinLaunder(Sema &S, CallExpr *TheCall) { return TheCall; } +static ExprResult BuiltinIsWithinLifetime(Sema &S, CallExpr *TheCall) { + if (checkArgCount(S, TheCall, 1)) +return ExprError(); + + ExprResult Arg = S.DefaultFunc

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-05 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/102044 Added a new `-Wpre-c++26-compat` warning for when this feature is used in C++26, and a different warning for when this is used in C++11 through C++20. >From 65f4c93a54888338ab5fe3e5b9f9f1228651eb3c Mon Sep 1

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

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

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-05 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] [Clang][Sema] Backport P2741R3 (static_assert with user-generat

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

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

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-05 Thread Mital Ashok via cfe-commits
MitalAshok wrote: This doesn't make sense to backport to C++98's `_Static_assert` extension (no `constexpr` member functions) CC @cor3ntin @AaronBallman Re: affects on libc++/any downstream: Other than the feature test macro, this extension should not affect any valid C++11/20 program, since

[clang] [Clang][Sema] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 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/3] [Clang][Sema] Backport P2741R3 (static_assert with user-gen

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

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

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -105,6 +105,11 @@ C2y Feature Support C23 Feature Support ^^^ +Non-comprehensive list of changes in this release +- MitalAshok wrote: https://github.com/llvm/llvm-project/commit/10c6d6349e51bb

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -134,7 +134,7 @@ void test() { } namespace cwg2798 { // cwg2798: 17 -#if __cpp_static_assert >= 202306 +#if __cplusplus > 202302L MitalAshok wrote: I guess this is one of the potentially-breaking changes that comes with changing the feature test macro. I

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 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/4] [Clang][Sema] Backport P2741R3 (static_assert with user-gen

[clang] [Clang] Backport P2741R3 (static_assert with user-generated message) to C++11 (PR #102044)

2024-08-06 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/5] [Clang][Sema] Backport P2741R3 (static_assert with user-gen

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

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

<    1   2   3   4   5   >