[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

2024-09-16 Thread Mital Ashok via cfe-commits
MitalAshok wrote: @shafik: Since this is a generated file, it is very easy to regenerate after a revert with `python3 clang/www/make_cxx_dr_status && git commit -am '[Clang][NFC] Update cxx_dr_status.html'` @Endilll: I've removed the other changes from `cxx_dr_status.html` manually from this

[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

2024-09-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/108817 >From f283645de806c71d93ec10bc7fcb933ccbfee156 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Mon, 16 Sep 2024 12:22:01 +0100 Subject: [PATCH 1/2] [Clang] Reject "this void" (CWG2915) --- clang/docs/Relea

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

2024-09-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok updated https://github.com/llvm/llvm-project/pull/108758 >From 0a6b4e83318af66888f6297549a806b5d81e4933 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 15 Sep 2024 15:48:59 +0100 Subject: [PATCH] [Clang] Allow user defined conversion implicit cast to _Comple

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

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

[clang] [Clang] Reject `this void` explicit object parameters (CWG2915) (PR #108817)

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

[clang] [Clang] Reject "this void" (CWG2915) (PR #108817)

2024-09-16 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/108817 https://cplusplus.github.io/CWG/issues/2915.html Previously, `struct A { void f(this void); };` was accepted with `A::f` being a member function with no non-object arguments, but it was still a little wonky

[clang] [Clang] Allow user defined conversion implicit cast to _Complex types in constant expressions (PR #108758)

2024-09-15 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/108758 This already worked with `-fexperimental-new-constant-interpreter` Fixes #108750 >From 0a6b4e83318af66888f6297549a806b5d81e4933 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Sun, 15 Sep 2024 15:48:59 +01

[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 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] 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] 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/4] [Clang] CWG2749: relational operators involving pointers to

[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] 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] [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] 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] [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] 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] 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
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
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
@@ -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
@@ -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][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][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] 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] 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] 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
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][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][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] `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] `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
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] 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] 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-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] 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 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] 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] 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] 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] 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] 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 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] 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] 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/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
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/11] [Clang] Add attribute for consteval builtins; Declare con

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

[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][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] [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] [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] [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] [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 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
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][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][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -363,5 +363,7 @@ considered for standardization. Please post on the | device extension | `'ompx_bare' clause on 'target teams' construct | :good:`prototyped` | #66844, #70612 | |

[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
@@ -1504,7 +1504,7 @@ Conditional ``explicit`` __cpp_conditional_explicit C+ ``static operator()``__cpp_static_call_operator C++23 C++03 Attributes on Lambda-Expressions

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

[clang] [llvm] [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
@@ -105,6 +105,11 @@ C2y Feature Support C23 Feature Support ^^^ +Non-comprehensive list of changes in this release +- MitalAshok wrote: Opened as #102134 https://github.com/llvm/llvm-project/pu

[clang] [llvm] [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 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/6] [Clang][Sema] Backport P2741R3 (static_assert with user-gen

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

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -12238,7 +12255,6 @@ void Sema::CheckMain(FunctionDecl* FD, const DeclSpec& DS) { << FixItHint::CreateRemoval(DS.getConstexprSpecLoc()); FD->setConstexprKind(ConstexprSpecKind::Unspecified); } MitalAshok wrote: ```suggestion } ``` (Unnece

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

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -8052,10 +8061,7 @@ NamedDecl *Sema::ActOnVariableDeclarator( } // Special handling of variable named 'main'. - if (Name.getAsIdentifierInfo() && Name.getAsIdentifierInfo()->isStr("main") && - NewVD->getDeclContext()->getRedeclContext()->isTranslationUnit() && -

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

2024-08-06 Thread Mital Ashok via cfe-commits
@@ -61,6 +64,64 @@ int q(void) // expected-no-diagnostics int main; +#elif TEST11 +extern "C" { + namespace Y { +int main; // expected-error {{main cannot be declared as global variable}} MitalAshok wrote: These diagnostics could be similar to: https://

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

2024-08-06 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] p3 requirements (PR #101853)

2024-08-06 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok approved this pull request. Diagnostic changes are a minor nit, LGTM otherwise https://github.com/llvm/llvm-project/pull/101853 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[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
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, LangOpts.CPlusPlus23 ? "202211L" : LangOpts.CPlusPlus17 ? "201603L" : "200907");

[clang] [Clang][NFC] Restore "Non-comprehensive list of changes in this release" in ReleaseNotes (PR #102134)

2024-08-06 Thread Mital Ashok via cfe-commits
MitalAshok wrote: See comment: https://github.com/llvm/llvm-project/commit/10c6d6349e51bb245b9deec4aafca9885971135b#r145078148 (This is a separate PR to make sure it isn't reverted as part of a bigger change) https://github.com/llvm/llvm-project/pull/102134 __

[clang] [Clang][NFC] Restore "Non-comprehensive list of changes in this release" in ReleaseNotes (PR #102134)

2024-08-06 Thread Mital Ashok via cfe-commits
https://github.com/MitalAshok created https://github.com/llvm/llvm-project/pull/102134 This was removed in 10c6d6349e51bb245b9deec4aafca9885971135b >From 664647de07eaa6f1b4b0f94594e867740cb99717 Mon Sep 17 00:00:00 2001 From: Mital Ashok Date: Tue, 6 Aug 2024 13:32:04 +0100 Subject: [PATCH] [N

[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

[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] 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
@@ -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
@@ -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

  1   2   3   4   5   >