[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-15 Thread Aaron Ballman via cfe-commits
@@ -13805,29 +13804,24 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // OpenCL v1.2 s6.5.3: __constant locals must be constant-initialized. // This is true even in C++ for OpenCL. } else if (VDecl->getType().getAddressSpace() ==

[clang] [AST][RecoveryExpr] Fix a crash on c89/c90 invalid InitListExpr (#88008) (PR #88014)

2024-04-15 Thread Aaron Ballman via cfe-commits
@@ -423,6 +423,8 @@ Bug Fixes in This Version - Fixed a regression in CTAD that a friend declaration that befriends itself may cause incorrect constraint substitution. (#GH86769). +- Fixed an assertion failure on invalid InitListExpr in C90 mode (#GH88008).

[clang] [Clang] Properly set the value category of dependent unary operators (PR #88740)

2024-04-15 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, good catch! https://github.com/llvm/llvm-project/pull/88740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix __is_trivially_equaltiy_comparable documentation (PR #88528)

2024-04-15 Thread Aaron Ballman via cfe-commits
@@ -1640,7 +1640,7 @@ The following type trait primitives are supported by Clang. Those traits marked were made trivially relocatable via the ``clang::trivial_abi`` attribute. * ``__is_trivially_equality_comparable`` (Clang): Returns true if comparing two objects of the

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-15 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > I'm surprised about the "compiler-rt is not supported on windows" comment - > in our distribution, we've been building compiler-rt on windows for years, > and I don't remember significant issues. > > It's true that `__divsc3` is not available _without_ compiler-rt (i.e.

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-12 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: The precommit CI failures are real; I'm still investigating what's going sideways. https://github.com/llvm/llvm-project/pull/88546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-12 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,304 @@ +//===- SemaCUDA.h - Semantic Analysis for CUDA constructs -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier:

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/88559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaCUDA` (PR #88559)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Generally LGTM, though I'd like someone more familiar with CUDA to sign off as well. https://github.com/llvm/llvm-project/pull/88559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/88546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/88546 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/88161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Simplify RenamerClangTidyCheck API (PR #88268)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/88268 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (PR #88269)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM again, thanks for the extra work to get JSON dumping as well! https://github.com/llvm/llvm-project/pull/88269 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-12 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/87909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 33779b8 - Reword a diagnostic; NFC

2024-04-12 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-12T07:43:39-04:00 New Revision: 33779b861d748ed18b8d4f9cbad3a84deaa95e9f URL: https://github.com/llvm/llvm-project/commit/33779b861d748ed18b8d4f9cbad3a84deaa95e9f DIFF: https://github.com/llvm/llvm-project/commit/33779b861d748ed18b8d4f9cbad3a84deaa95e9f.diff

[clang] [Clang] Fix AST dump for {CXXDefaultArgExpr, CXXDefaultInitExpr} (PR #88269)

2024-04-11 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM but you should check JSONNodeDumper.cpp as well to see if it needs similar changes. https://github.com/llvm/llvm-project/pull/88269 ___ cfe-commits mailing list

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > Note that > > > ```c++ > > > auto div(_Complex float lhs, _Complex float rhs) { > > > return lhs / rhs; > > > } > > > > > > int main() { > > > return __real div(1.f, 2.f); > > > } > > > ``` > > > > > > > > > > > > > > > > > > > > > > > >

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > You're missing checks for type domain rules, so things like: > > * converting between `float _Complex` and `double _Complex` > > * common type of `float _Complex` and `double` > > * result of `int` and `float _Complex` > > * complex types not allowed in

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %clang_cc1 -verify -std=c99 %s + +/* WG14 N620, N638, N657, N694, N809: Yes* + * Complex and imaginary support in + * + * NB: Clang supports _Complex but not _Imaginary. In C99, _Complex support is + * required outside of freestanding, but _Imaginary

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
@@ -373,6 +355,10 @@ C99 implementation status Yes +(2): Clang supports _Complex type specifiers but +does not support _Imaginary type specifiers. Support for +_Imaginary is optional in C99 which is why Clang is fully conforming. AaronBallman

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %clang_cc1 -verify -std=c99 %s + +/* WG14 N620, N638, N657, N694, N809: Yes* + * Complex and imaginary support in + * + * NB: Clang supports _Complex but not _Imaginary. In C99, _Complex support is + * required outside of freestanding, but _Imaginary

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-11 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %clang_cc1 -verify -std=c99 %s + +/* WG14 N620, N638, N657, N694, N809: Yes* + * Complex and imaginary support in + * + * NB: Clang supports _Complex but not _Imaginary. In C99, _Complex support is + * required outside of freestanding, but _Imaginary

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-10 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Note that > > ```c++ > auto div(_Complex float lhs, _Complex float rhs) { > return lhs / rhs; > } > > int main() { > return __real div(1.f, 2.f); > } > ``` > > will fail to link on windows due to `__divsc3` not being available. Similar > programs probably also fail

[clang] 4d80dff - int -> uintptr_t to silence diagnostics

2024-04-10 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-10T13:57:18-04:00 New Revision: 4d80dff819d1164775d0d55fc68bffedb90ba53c URL: https://github.com/llvm/llvm-project/commit/4d80dff819d1164775d0d55fc68bffedb90ba53c DIFF: https://github.com/llvm/llvm-project/commit/4d80dff819d1164775d0d55fc68bffedb90ba53c.diff

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/87824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/87824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,48 @@ +// RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify=expected,pre26 -pedantic %s +// RUN: %clang_cc1 -std=c++2c -fsyntax-only -verify=expected,compat -Wpre-c++26-compat %s +// RUN: %clang_cc1 -std=c++2c -fsyntax-only -verify %s + +struct S { + void a() =

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -1415,6 +1416,12 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator , : diag::ext_defaulted_deleted_function) << 1 /* deleted */; BodyKind = Sema::FnBodyKind::Delete; + DeletedMessage = ParseCXXDeletedFunctionMessage(); +

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -70,8 +108,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef( ? diag::warn_cxx98_compat_defaulted_deleted_function : diag::ext_defaulted_deleted_function) << 1 /* deleted */; - Actions.SetDeclDeleted(FnD, KWLoc); +

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -1936,6 +1936,9 @@ void TextNodeDumper::VisitFunctionDecl(const FunctionDecl *D) { if (D->isTrivial()) OS << " trivial"; + if (const StringLiteral *M = D->getDeletedMessage()) AaronBallman wrote: You should do similar in JSONNodeDumper.cpp as

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -1981,21 +1981,35 @@ class FunctionDecl : public DeclaratorDecl, }; - /// Stashed information about a defaulted function definition whose body has - /// not yet been lazily generated. - class DefaultedFunctionInfo final - : llvm::TrailingObjects { + /// Stashed

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

2024-04-10 Thread Aaron Ballman via cfe-commits
@@ -8857,7 +8856,7 @@ def err_nontemporal_builtin_must_be_pointer_intfltptr_or_vector : Error< "address argument to nontemporal builtin must be a pointer to integer, float, " "pointer, or a vector of such types (%0 invalid)">; -def err_deleted_function_use :

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

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/86526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. In general, this LGTM, thank you! I did spot some minor stuff, but feel free to fix it up when landing. https://github.com/llvm/llvm-project/pull/86526 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/87792 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaSYCL` (PR #88086)

2024-04-10 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88086 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, if (isImaginary) break; // Cannot be repeated. isImaginary = true; continue; // Success. +case '_': + if (isFPConstant) +break; // Invalid for floats

[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -1127,9 +1148,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, // wb and WB are allowed, but a mixture of cases like Wb or wB is not. We // explicitly do not support the suffix in C++ as an extension because a // library-based UDL

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > I'm not convinced I have sufficient tests, so I'm especially interested in > > some help figuring out what else to test and how to go about it. I don't > > believe we need to test library behavior here because Clang does not > > provide any library support for complex

[clang] f48895a - [C11] Claim conformance to WG14 N1514

2024-04-09 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-09T13:57:36-04:00 New Revision: f48895a8be517be058153385438ad64fa09d4883 URL: https://github.com/llvm/llvm-project/commit/f48895a8be517be058153385438ad64fa09d4883 DIFF: https://github.com/llvm/llvm-project/commit/f48895a8be517be058153385438ad64fa09d4883.diff

[clang] [C99] Claim conformance for _Complex support (PR #88161)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: I'm not convinced I have sufficient tests, so I'm especially interested in some help figuring out what else to test and how to go about it. I don't believe we need to test library behavior here because Clang does not provide any library support for complex types in

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/87824 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -61,7 +61,28 @@ class ParentMapContext::ParentMap { template friend struct ::MatchParents; /// Contains parents of a node. - using ParentVector = llvm::SmallVector; + class ParentVector { + public: +ParentVector() = default; +explicit ParentVector(size_t n,

[clang] Fix quadratic slowdown in AST matcher parent map generation (PR #87824)

2024-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this, what a great speed-up! Generally LGTM, though I think you should add a release note to clang/docs/ReleaseNotes.rst so users know about the significant performance improvement. https://github.com/llvm/llvm-project/pull/87824

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Using the suggested code and this one usage: > > ``` > MY_MACRO(myglob); > ``` > > No suggestion is made. My understanding is because the full range of the > NamedDecl would contain `awesome_myglob` which isn't entirely within a macro > arg. Oh, awesome, thank you for

[clang] 5278594 - Add a diagnostic group for tentative array definitions

2024-04-09 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-09T10:40:08-04:00 New Revision: 5278594d7ef8c6814578f2f600016fef5ad058c9 URL: https://github.com/llvm/llvm-project/commit/5278594d7ef8c6814578f2f600016fef5ad058c9 DIFF: https://github.com/llvm/llvm-project/commit/5278594d7ef8c6814578f2f600016fef5ad058c9.diff

[clang] Rework the printing of attributes (PR #87281)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > And `final` as well as `override`? (This is why I'm not convinced we should > > be backporting anything -- the problem is with printing in general and will > > crop up in various places, so we're not really fixing a regression so much > > as playing whack-a-mole with a

[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)

2024-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/74510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > the user may not have the ability to change the definition of the macro to > > be able to appease the check > > My understanding of this PR is that the user would only need to change what > they pass into the macro, not the macro itself, or? E.g. > > ```c++ >

[clang] Rework the printing of attributes (PR #87281)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: And `final` as well as `override`? (This is why I'm not convinced we should be backporting anything -- the problem is with printing in general and will crop up in various places, so we're not really fixing a regression so much as playing whack-a-mole with a few cases.)

[clang] [clang] Disable missing definition warning on pure virtual functions (PR #74510)

2024-04-09 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! Do you need someone to land this on your behalf? https://github.com/llvm/llvm-project/pull/74510 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -661,6 +680,10 @@ namespace dr553 { } // dr554: na + +// dr555: na AaronBallman wrote: Avoiding copying tests is a good idea, that just means we need to come up with different tests. ;-) CWG466 is solely about cv-qualification and pseudo destructors.

[clang] Rework the printing of attributes (PR #87281)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > > @erichkeane, thank you. What's the process of including this in the > > > > next release? > > > > > > > > > After CI is complete, you can click "Squash and Merge" below (if you > > > cannot, let us know and someone can do it for you), and it'll be included > > >

[clang] [clang] Add tests for some CWG 5xx issues (PR #87909)

2024-04-09 Thread Aaron Ballman via cfe-commits
@@ -661,6 +680,10 @@ namespace dr553 { } // dr554: na + +// dr555: na AaronBallman wrote: https://cplusplus.github.io/CWG/issues/555.html is not a duplicate, it's marked CD5 not dup? https://github.com/llvm/llvm-project/pull/87909

[clang] [NFC][OpenMP] Split nesting_of_regions test (PR #87842)

2024-04-09 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Thank you for improving test run times, that's really appreciated! https://github.com/llvm/llvm-project/pull/87842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce `SemaHLSL` (PR #87912)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/87912 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Update __cpp_concepts macro (PR #87998)

2024-04-08 Thread Aaron Ballman via cfe-commits
@@ -110,6 +110,11 @@ C++20 Feature Support templates (`P1814R0 `_). (#GH54051). +- __cpp_concepts macro now updated to `202002L`, as we are confident that, + modulo a handful of bugs and core issues, that our concepts implementation is +

[clang] Update __cpp_concepts macro (PR #87998)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/87998 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Update __cpp_concepts macro (PR #87998)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, feel free to take or leave my suggestion on the release note. https://github.com/llvm/llvm-project/pull/87998 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [clang-tidy] Allow renaming macro arguments (PR #87792)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: I am not certain we want to allow this without some kind of option. The trouble is: the user may not have the ability to change the definition of the macro to be able to appease the check. However, the clang-tidy folks may have different

[clang-tools-extra] [clang-tidy] rename designated initializers (PR #86976)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/86976 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] rename designated initializers (PR #86976)

2024-04-08 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > @AaronBallman Ready to go? Yup, it was already accepted by the code owners. Based on our chat during office hours, I'm guessing you need help landing these changes. I'll go ahead and land them on your behalf. Feel free to let us know if we accept something and you can't

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-04-08 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Do you mean that you would reject a proposal that adds Clang-specific trait > (with another name) that implements P1144's semantics? So long as it checks all the boxes in our usual [criteria](https://clang.llvm.org/get_involved.html#criteria) for extensions, I'd see no

[clang] [clang][NFC] Adjust TBAA Base Info API (PR #73263)

2024-04-08 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, sorry for this falling off my radar! https://github.com/llvm/llvm-project/pull/73263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [C99] Claim conformance to WG14 N717 (PR #87228)

2024-04-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/87228 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [C99] Claim conformance to WG14 N717 (PR #87228)

2024-04-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Thanks Aaron for putting up with all my offline requests. LGTM Thank you for all the excellent suggestions, this was a lot harder to test correctly than I realized at first. https://github.com/llvm/llvm-project/pull/87228 ___

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-05 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } // cxx-warning{{unused function 'f'}}

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-04-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Based on the poll results from Tokyo, P2786 is the direction EWG has taken for this functionality, so we should be focusing our efforts on supporting that direction. If WG21 changes direction again, we can shift again, (this builtin exists to support the standard's type

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Aaron Ballman via cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(unsigned char, signed char)); static_assert(__is_layout_compatible(int[], int[])); static_assert(__is_layout_compatible(int[2], int[2])); -

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman requested changes to this pull request. Marking as requesting changes until we get agreement on the behavior for the Microsoft ABI. https://github.com/llvm/llvm-project/pull/87130 ___ cfe-commits mailing list

[clang] [Sema] Mark alias/ifunc targets used and consider mangled names (PR #87130)

2024-04-05 Thread Aaron Ballman via cfe-commits
@@ -1980,6 +1981,23 @@ static void handleWeakRefAttr(Sema , Decl *D, const ParsedAttr ) { D->addAttr(::new (S.Context) WeakRefAttr(S.Context, AL)); } +// Mark alias/ifunc target as used. For C++, we look up the demangled name +// ignoring parameters. This should handle the

[clang] Rework the printing of attributes (PR #87281)

2024-04-05 Thread Aaron Ballman via cfe-commits
@@ -73,3 +73,15 @@ class C { // CHECK: void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3))); void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3))); }; + +#define ANNOTATE_ATTR __attribute__((annotate("Annotated"))) +ANNOTATE_ATTR int

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Aaron Ballman via cfe-commits
@@ -1741,8 +1741,10 @@ void is_layout_compatible(int n) static_assert(!__is_layout_compatible(unsigned char, signed char)); static_assert(__is_layout_compatible(int[], int[])); static_assert(__is_layout_compatible(int[2], int[2])); -

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > However, at the language level, I cannot find any wording either way. > > In my reading, http://eel.is/c++draft/basic.types.general#11 makes any type > layout-compatible with itself, and even ignores cv-qualification: > > > Two types cv1 T1 and cv2 T2 are

[clang] [clang] Reject VLAs in `__is_layout_compatible()` (PR #87737)

2024-04-05 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > We should not reject (ie, make the programm ill-form) _any_ type. Just return > `false` in all of these cases GCC rejects incomplete types: https://godbolt.org/z/xWbes5Wsc Both Clang and GCC reject instantiating templates with VLAs but accept it in the builtin:

[clang] Fix formatting of a comment; NFC (PR #87739)

2024-04-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/87739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix formatting of a comment; NFC (PR #87739)

2024-04-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you for the cleanup! https://github.com/llvm/llvm-project/pull/87739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] Fix formatting of a comment; NFC (PR #87739)

2024-04-05 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/87739 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-04-04 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > > Is that still worth mention in the release notes do you think? > > > > > > Oh duh, that's right, this requires someone to define the `__need` macro to > > get it, so no, I don't think it needs a release note. Sorry for the noise! > >  thanks for bearing with me on

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-04-04 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > Is that still worth mention in the release notes do you think? Oh duh, that's right, this requires someone to define the `__need` macro to get it, so no, I don't think it needs a release note. Sorry for the noise! https://github.com/llvm/llvm-project/pull/86748

[clang] fff2690 - [C23] Remove WG14 N2416 from the C status page

2024-04-03 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-03T13:28:28-04:00 New Revision: fff2690eba58f3a548865b5246b09233663c680d URL: https://github.com/llvm/llvm-project/commit/fff2690eba58f3a548865b5246b09233663c680d DIFF: https://github.com/llvm/llvm-project/commit/fff2690eba58f3a548865b5246b09233663c680d.diff

Re: [clang] 468dc32 - [NFC] Make `DeclContext::noload_lookup()` accept transparent context

2024-04-03 Thread Aaron Ballman via cfe-commits
I'm not opposed to the changes, but they do seem like functional changes -- we used to trigger an assertion and now we're swallowing it and changing the behavior; can you add a test case that would have previously asserted? ~Aaron On Wed, Apr 3, 2024 at 3:05 AM Chuanqi Xu via cfe-commits wrote:

[clang] 6b2a466 - [C11] Claim conformance to WG14 N1482

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T16:26:29-04:00 New Revision: 6b2a4668b99ef47f567709bcf6f57bc60c35eea9 URL: https://github.com/llvm/llvm-project/commit/6b2a4668b99ef47f567709bcf6f57bc60c35eea9 DIFF: https://github.com/llvm/llvm-project/commit/6b2a4668b99ef47f567709bcf6f57bc60c35eea9.diff

[clang] 3cf9f2c - [C99] Claim conformance to WG14 N782

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T13:36:45-04:00 New Revision: 3cf9f2c3a4b3aaffa9c1dbbe34624bcaabefd390 URL: https://github.com/llvm/llvm-project/commit/3cf9f2c3a4b3aaffa9c1dbbe34624bcaabefd390 DIFF: https://github.com/llvm/llvm-project/commit/3cf9f2c3a4b3aaffa9c1dbbe34624bcaabefd390.diff

[clang] a5932e1 - Add a link to WG14 N835 to the status page

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T13:14:09-04:00 New Revision: a5932e182ba7dd8f1ae131038bab051aea13e688 URL: https://github.com/llvm/llvm-project/commit/a5932e182ba7dd8f1ae131038bab051aea13e688 DIFF: https://github.com/llvm/llvm-project/commit/a5932e182ba7dd8f1ae131038bab051aea13e688.diff

[clang] f462d9a - [C99] Claim conformance to "remove deprecation of aliased array parameters"

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T13:08:27-04:00 New Revision: f462d9a97dbbeef712ef0de206ec17f5ed7e15c8 URL: https://github.com/llvm/llvm-project/commit/f462d9a97dbbeef712ef0de206ec17f5ed7e15c8 DIFF: https://github.com/llvm/llvm-project/commit/f462d9a97dbbeef712ef0de206ec17f5ed7e15c8.diff

[clang] 74483bd - [C99] Remove entry for LIA compatibility

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T12:57:38-04:00 New Revision: 74483bd6f6bdecdd16efbfcd183b5e29e0234a3a URL: https://github.com/llvm/llvm-project/commit/74483bd6f6bdecdd16efbfcd183b5e29e0234a3a DIFF: https://github.com/llvm/llvm-project/commit/74483bd6f6bdecdd16efbfcd183b5e29e0234a3a.diff

[clang] 668c1ea - [C99] Update paper number tracked for arrays & lvalues; NFC

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T12:36:27-04:00 New Revision: 668c1ea4aa7f3907b92116748af087f2bb006a97 URL: https://github.com/llvm/llvm-project/commit/668c1ea4aa7f3907b92116748af087f2bb006a97 DIFF: https://github.com/llvm/llvm-project/commit/668c1ea4aa7f3907b92116748af087f2bb006a97.diff

[clang] f619868 - [C99] Claim conformance to "additional floating-point characteristics in "

2024-04-02 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-02T12:15:10-04:00 New Revision: f6198686b866d0a1efe7ce88f71c4293930c2dfe URL: https://github.com/llvm/llvm-project/commit/f6198686b866d0a1efe7ce88f71c4293930c2dfe DIFF: https://github.com/llvm/llvm-project/commit/f6198686b866d0a1efe7ce88f71c4293930c2dfe.diff

[clang] [clang] Fix crash when inheriting from a cv-qualified type (PR #70594)

2024-04-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman closed https://github.com/llvm/llvm-project/pull/70594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-04-02 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > FWIW, I did verify that it's very unlikely the changes in this PR will > > break existing code: > > https://sourcegraph.com/search?q=context:global+__need_unreachable+-file:.*clang.*=keyword=0, > > so that's a good thing. > > > I do wonder if we could have the broader

[clang] [clang]Treat arguments to builtin type traits as template type arguments (PR #87132)

2024-04-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM, thank you! No need for a release note because the changes are correcting an issue introduced in 19.x. https://github.com/llvm/llvm-project/pull/87132 ___ cfe-commits mailing list

[clang] cbd48b1 - [C99] Claim conformance to "conversion of array to pointer not limited to lvalues"

2024-04-01 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-01T14:54:03-04:00 New Revision: cbd48b184eca1ca73e6f20575501d94ad30fbd58 URL: https://github.com/llvm/llvm-project/commit/cbd48b184eca1ca73e6f20575501d94ad30fbd58 DIFF: https://github.com/llvm/llvm-project/commit/cbd48b184eca1ca73e6f20575501d94ad30fbd58.diff

[clang] 4746877 - [C99] Claim conformance to WG14 N570

2024-04-01 Thread Aaron Ballman via cfe-commits
Author: Aaron Ballman Date: 2024-04-01T13:53:14-04:00 New Revision: 4746877c2716224dc87c69750bdd0df95b6d5b16 URL: https://github.com/llvm/llvm-project/commit/4746877c2716224dc87c69750bdd0df95b6d5b16 DIFF: https://github.com/llvm/llvm-project/commit/4746877c2716224dc87c69750bdd0df95b6d5b16.diff

[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: FWIW, I did verify that it's very unlikely the changes in this PR will break existing code: https://sourcegraph.com/search?q=context:global+__need_unreachable+-file:.*clang.*=keyword=0, so that's a good thing. > I do wonder if we could have the broader builtin headers

[clang] [clang] Fix incorrect line numbers with -E and raw string (#47577) (PR #77021)

2024-04-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: Thank you for this! The functional changes look good to me, but it might make sense to rename the test (or add comments) to make it more clear what's being tested and why, and we should have a release note so users know about the fix.

[clang] [clang] Fix incorrect line numbers with -E and raw string (#47577) (PR #77021)

2024-04-01 Thread Aaron Ballman via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -E %s | FileCheck %s +// CHECK: AAA +// CHECK-NEXT: BBB +R"( +AAA)" +BBB AaronBallman wrote: Thanks for the explanation! Perhaps a better name for the test file is `raw_string_print.cpp` or something along those lines, so

[clang] [clang] Fix incorrect line numbers with -E and raw string (#47577) (PR #77021)

2024-04-01 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/77021 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix incorrect line numbers with -E and raw string (#47577) (PR #77021)

2024-04-01 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: > > This will need a release note > > Are you asking me to do this? I did not see any instructions about how to do > this. Sorry for not seeing this question earlier! Yes, you should add a release note to clang/docs/ReleaseNotes.rst; we have a section for bug fixes:

<    1   2   3   4   5   6   7   8   9   10   >