[PATCH] D132821: [clang][Parse] Fix crash when emitting template diagnostic

2022-08-29 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:779 + "|refers to a variable template||refers to a concept|" + "refers to a concept template}1">; def err_id_after_template_in_nested_name_spec : Error< Is "concept templ

[PATCH] D132821: [clang][Parse] Fix crash when emitting template diagnostic

2022-08-29 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. This revision is now accepted and ready to land. Thanks for looking into this so quickly. LGTM with Aaron's suggested changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132821/new/ https://revi

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-09-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D130867#3759181 , @aaron.ballman wrote: > Thanks for working on this; these sort of improvements to compile time > overhead are very much appreciated! > > Has this been tested against libc++ (our preccommit CI doesn't test that)

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-09-07 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128372/new/ https://reviews.llvm.org/D128372 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-b

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-09-09 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb abandoned this revision. cjdb added a comment. I had not realised that libc++ was listed as a reviewer. I am going to abandon this revision, since I only wish to interact with that community when it is both business-critical and unavoidable. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-09-11 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D130867#3781492 , @ldionne wrote: > In D130867#3781429 , @cjdb wrote: > >> I had not realised that libc++ was listed as a reviewer. > > The change does have an impact on libc++, so I think

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-06-26 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 440079. cjdb added a comment. rebases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116280/new/ https://reviews.llvm.org/D116280 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Bas

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-06-27 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp:76 + +auto Methods = Arg->getType()->getAsCXXRecordDecl()->methods(); +auto Clear = llvm::find_if(Methods, [](const CXXMethodDecl *F) { denik wrote: > C

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-07-07 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp:128 + << FixItHint::CreateReplacement(ReplacementRange, "clear"); +} else { + diag(MemberLoc, "ignoring the result of 'empty()'"); Let's elimi

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-07-07 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. Thanks for working on this! I'll merge this on your behalf once there's maintainer approval. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128372/new/ https://reviews.llvm.org/D128372 ___

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-04-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D116203#3255018 , @aaron.ballman wrote: > In D116203#3220165 , @aaron.ballman > wrote: > >> The summary for the patch explains what's being added, but there's really no >> information a

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-04-03 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. I've noticed that libstdc++ has `using __remove_cv = typename remove_cv::type`, which causes Clang to chuck a wobbly. Changing from `KEYWORD` to `TYPE_TRAIT_1` didn't seem to fix anything. Is there a way we can work around this, or should we just rename `__remove_cv` and f

[PATCH] D130058: [Clang] Diagnose ill-formed constant expression when setting a non fixed enum to a value outside the range of the enumeration values

2022-07-27 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/test/SemaCXX/constant-expression-cxx11.cpp:2420 + constexpr E1 x2 = static_cast(8); // expected-error {{must be initialized by a constant expression}} + // expected-note@-1 {{integer value 8 is outside the valid range of values [-

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-07-30 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 448806. cjdb added a subscriber: rsmith. cjdb added a comment. I think this covers all the feedback @rsmith has provided, though my treatment of `BuildPointerType` and `BuildReferenceType` might be wrong. Hopefully `__make_signed` and `__make_unsigned` are corr

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-07-30 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked 13 inline comments as done. cjdb added inline comments. Comment at: clang/lib/Parse/ParseExpr.cpp:1755-1756 + Tok.setKind(tok::identifier); + Diag(Tok, diag::ext_keyword_as_ident) + << Tok.getIdentifierInfo()->getName() << 0; + goto ParseIdenti

[PATCH] D130867: WORK-IN-PROGRESS [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-07-31 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: aaron.ballman, rsmith. Herald added a reviewer: NoQ. Herald added a project: All. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. `std::invoke` and `std::invoke_r` are fairly easy to im

[PATCH] D131084: Add support for specifying the severity of a SARIF Result.

2022-08-03 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D131084#3697211 , @vaibhav.y wrote: > Submitting for review: > > Some notes: > > There are a couple of ways I think we can acheive this, per the spec: > > 1. The reportingDescriptor (rule) objects can be given a default > configu

[PATCH] D131084: Add support for specifying the severity of a SARIF Result.

2022-08-03 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. It seems I got confused and conflated the two this morning. In D131084#3697525 , @vaibhav.y wrote: >> Hmm, we can probably use "informational" for notes, warnings, and remarks, >> but I'm kinda partial to proposing the latter two u

[PATCH] D131084: Add support for specifying the severity of a SARIF Result.

2022-08-04 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a subscriber: Naghasan. cjdb added a comment. In D131084#3699223 , @aaron.ballman wrote: > In D131084#3697678 , @cjdb wrote: > >> It seems I got confused and conflated the two this morning. >> >> In D1

[PATCH] D130894: [clang] Print more information about failed static assertions

2022-08-05 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thank you so much for working on this! It's been on my todo list for a while and just haven't gotten around to it. In D130894#3702166 , @aaron.ballman wrote: > In D130894#3701749 , @tbaede

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-08-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 450581. cjdb retitled this revision from "WORK-IN-PROGRESS [clang] adds builtin `std::invoke` and `std::invoke_r`" to "[clang] adds builtin `std::invoke` and `std::invoke_r`". cjdb edited the summary of this revision. cjdb added a comment. updates commit messag

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-08-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 450584. cjdb added a comment. adds logic to diagnose misqualified pointer-to-member functions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130867/new/ https://reviews.llvm.org/D130867 Files: clang/docs/Release

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-08-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 450585. cjdb added a comment. fixes commit update mistake and rebases to ToT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116280/new/ https://reviews.llvm.org/D116280 Files: clang/include/clang/Basic/Diagnosti

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-08-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 450587. cjdb added a comment. rebases to ToT Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130867/new/ https://reviews.llvm.org/D130867 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/Builtins.de

[PATCH] D130867: [clang] adds builtin `std::invoke` and `std::invoke_r`

2022-08-07 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:5726-5731 + FirstArgType = S.BuiltinAddReference( + dyn_cast( + dyn_cast(FirstArgType)->getNamedType()) + ->getArg(0) + .getAsType(), + Sema::UTTKind::AddLvalueReference,

[PATCH] D128372: [Clang-Tidy] Empty Check

2022-08-08 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StandaloneEmptyCheck.cpp:177-178 + diag(NonMemberLoc, "ignoring the result of '%0', did you mean 'clear()'?") + << llvm::dyn_cast(NonMemberCall->getCalleeDecl()) + ->getQ

[PATCH] D130894: [clang] Print more information about failed static assertions

2022-08-09 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. This revision is now accepted and ready to land. In D130894#3709431 , @aaron.ballman wrote: > In D130894#3709027 , @tbaeder wrote: > >> I don't really want to bi

[PATCH] D104887: [clang] Evaluate strlen of strcpy argument for -Wfortify-source.

2021-07-15 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thanks for getting around to this! Just a nit and a clarifying question. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:821 + "'%0' will always overflow; destination buffer has size %1," + " but the source string has length %2 (including nu

[PATCH] D102728: [clang][Sema] removes -Wfree-nonheap-object reference param false positive

2021-07-19 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 360016. cjdb added a comment. rebases to activate CI Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102728/new/ https://reviews.llvm.org/D102728 Files: clang/lib/Sema/SemaChecking.cpp clang/test/Sema/warn-free

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-20 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: aaron.ballman, rsmith, gbiv, dblaikie, cor3ntin. Herald added a reviewer: george.burgess.iv. Herald added subscribers: usaxena95, kadircet. cjdb requested review of this revision. Herald added subscribers: cfe-commits, ilya-biryukov. Herald added a

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-20 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Lex/PPLexerChange.cpp:437 + diag::pp_pragma_include_instead_system_reserved) +<< Filename << 2 << ('{' + Aliases + '}'); + } I wasn't able to work out how to escape braces inside diagn

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-20 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D106394#2891647 , @zoecarver wrote: > Can't wait to start using this! (Note: this is not a full review, just some > thoughts.) > > Do you have a test case where > > // private: header one > *exists* > > // private: heade

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-20 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 360317. cjdb marked an inline comment as done. cjdb added a comment. - renames test files so they better describe intention - replaces `SmallVector` with `SetVector` - replaces `std::accumulate` with `llvm::interleave` Repository: rG LLVM Github Monorepo CHA

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-21 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D106394#2892832 , @sammccall wrote: > This is pretty interesting from a tooling perspective! > > Some prior art here are the include-what-you-use "pragmas" >

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-21 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 360519. cjdb added a comment. - renames files - makes it possible for `#pragma GCC system_header` to come after includes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106394/new/ https://reviews.llvm.org/D106394

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-21 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D106394#2893681 , @Quuxplusone wrote: > If IWYU has already developed a de facto standard for this information, I > would recommend libc++ just use it (perhaps with no changes needed in clang > at all). This would have the bene

[PATCH] D102728: [clang][Sema] removes -Wfree-nonheap-object reference param false positive

2021-07-21 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9a72580a548d: [clang][Sema] removes -Wfree-nonheap-object reference param false positive (authored by cjdb). Changed prior to commit: https://revi

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thanks for the first pass @aaron.ballman! Some clarifying questions, but I think I have enough of your other comments to work on while you ponder these. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:303 InGroup>; +def pp_pragma_include_in

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked 2 inline comments as done. cjdb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:307-310 +def pp_pragma_include_instead_unexpected_token : Warning< + "'#pragma include_instead' expects '%0' as its next token; got '%1' instead">, +

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 361014. cjdb marked 12 inline comments as done. cjdb added a comment. - applies all of @aaron.ballman's suggested changes - turns warnings into errors and deletes warning group - replaces `interleave` with `join` - properly abandons LF transmuting The only thing

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-23 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 361357. cjdb marked 11 inline comments as done. cjdb added a comment. applies all of @aaron.ballman's remaining feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106394/new/ https://reviews.llvm.org/D106394

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-23 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:304 + +def pp_pragma_include_instead_not_sysheader : Error< + "'#pragma clang include_instead' cannot be used outside of system headers">, aaron.ballman wrote: > Can you pref

[PATCH] D106252: Implement P2092

2021-07-23 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. This revision is now accepted and ready to land. LGTM upon inspection. There aren't any cases in libc++ that I'm aware of that will break because of this, but I think it's a good practice to try and bootstrap the library for certainty. Please a

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-26 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe8a64e549126: [clang][pp] adds '#pragma include_instead' (authored by cjdb). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'"" Includes regression test for problem noted by @hans.

2021-07-27 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: aaron.ballman, rsmith, dblaikie. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This reverts commit 973de7185606a21fd5e9d5e8c014fbf898c0e72f

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-27 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 362116. cjdb retitled this revision from "Revert "Revert "[clang][pp] adds '#pragma include_instead'"" Includes regression test for problem noted by @hans." to "Revert "Revert "[clang][pp] adds '#pragma include_instead'""". cjdb edited the summary of this revis

[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

2021-07-28 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D106394#2905660 , @dblaikie wrote: > Just a thought (nothing to hold up this patch/suggest a revert/suggest any > immediate action), but: > >> The problem with extending this to non-system headers is that you need a way >> to te

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-28 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 362479. cjdb added a comment. - attempts to get CI passing (@aaron.ballman) - minimises test case (@hans) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106898/new/ https://reviews.llvm.org/D106898 Files: clang/

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-29 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 362806. cjdb marked an inline comment as done. cjdb added a subscriber: tstellar. cjdb added a comment. fixes up formatting and testing Will merge post-CI. @aaron.ballman do you approve this to be cherry-picked into LLVM 13? (cc @tstellar) Repository: rG LL

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-29 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:307 +def err_pragma_include_instead_system_reserved : Error< + "header '%0' is an implementation detail; #include %select{'%2'|either '%2' or '%3'|one of %2}1 instead">; + a

[PATCH] D106898: Revert "Revert "[clang][pp] adds '#pragma include_instead'""

2021-07-29 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG087195419719: Revert "Revert "[clang][pp] adds '#pragma include_instead'"" (authored by cjdb). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106898/new/ htt

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-04-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D116203#3431612 , @rjmccall wrote: > In D116203#3430332 , @aaron.ballman > wrote: > >> In D116203#3425512 , @cjdb wrote: >> >>> I've noticed that

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-04-07 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D116203#3435729 , @aaron.ballman wrote: > In D116203#3434761 , @rjmccall > wrote: > >> In D116203#3434515 , @cjdb wrote: >> >>> In D116203#34316

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-10 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 421836. cjdb edited the summary of this revision. cjdb added a comment. Herald added a project: All. adds `__is_copy_constructible`, `__is_copy_assignable`, `__is_move_constructible` (WIP), and `__is_move_assignable` (incomplete) Repository: rG LLVM Github M

[PATCH] D123885: Revert "Revert "Revert "[clang][pp] adds '#pragma include_instead'"""

2022-04-15 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: rsmith, aaron.ballman. Herald added subscribers: dexonsmith, usaxena95, kadircet, arphaman. Herald added a project: All. cjdb requested review of this revision. Herald added projects: clang, clang-tools-extra. Herald added a subscriber: cfe-commits.

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-04-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked an inline comment as done. cjdb added inline comments. Comment at: clang/lib/Sema/SemaType.cpp:9113 + BaseType.isReferenceable() || BaseType->isVoidType() + ? BuildPointerType(BaseType.getNonReferenceType(), Loc, EntityName) + : BaseType; --

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 423280. cjdb marked 3 inline comments as done. cjdb added a comment. - finishes `__is_move_constructible` and `__is_move_assignable` - fixes detecting C++ mode - clang-formats Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4889-4890 return T->isArrayType(); + case UTT_IsBoundedArray: +return T->isArrayType() && !T->isIncompleteArrayType(); + case UTT_IsUnboundedArray: aaron.ballman wrote: > Is a VLA a

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-18 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/test/SemaCXX/type-traits.cpp:764 + int t30[F(__is_bounded_array(void*))]; + int t31[F(__is_bounded_array(cvoid*))]; +} aaron.ballman wrote: > cjdb wrote: > > aaron.ballman wrote: > > > Any reason there's not a test

[PATCH] D119670: [clang] Warn on unqualified calls to std::move and std::forward

2022-02-13 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thanks for working on this! I'm overall very happy, but I don't see a test case for a unary `move` originating from another namespace. Comment at: clang/lib/Sema/SemaExpr.cpp:6422 +static void DiagnosedUnqualifiedCallsToStdFunctions(Sema &S, CallExpr *Cal

[PATCH] D119806: [clangd][NFC] includes missing headers

2022-02-14 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman. cjdb requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. `Shutdown.h` was transitively dep

[PATCH] D119806: [clangd][NFC] includes missing headers

2022-02-15 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd7b1c840ba4e: [clangd][NFC] includes missing headers (authored by cjdb). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119806/new/ https://reviews.llvm.org/

[PATCH] D123885: Revert "Revert "Revert "[clang][pp] adds '#pragma include_instead'"""

2022-04-22 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe9a902c7f755: Revert "Revert "Revert "[clang][pp] adds '#pragma include_instead'""" (authored by cjdb). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 424672. cjdb marked 5 inline comments as done. cjdb edited the summary of this revision. cjdb added a comment. - handles VLAs - adds `__is_referenceable` which is used by portions of the standard library Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-04-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 424673. cjdb added a comment. fixes formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116280/new/ https://reviews.llvm.org/D116280 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/

[PATCH] D124726: Suggest typoed directives in preprocessor conditionals

2022-05-06 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thanks for working on this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124726/new/ https://reviews.llvm.org/D124726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[PATCH] D129538: [clang] adds prototype for being able to alternate diagnostic formats

2022-07-11 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added a reviewer: aaron.ballman. Herald added a project: All. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. In an effort to move from unstructured text diagnostics to structured diagnostics, while kee

[PATCH] D129538: [clang] adds prototype for being able to alternate diagnostic formats

2022-07-11 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 443833. cjdb added a comment. `arc diff` no longer seems to autoformat Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129538/new/ https://reviews.llvm.org/D129538 Files: clang/include/clang/Basic/Diagnostic.h

[PATCH] D129835: [clang] adds a discardable attribute

2022-07-14 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added a reviewer: aaron.ballman. Herald added a subscriber: jdoerfert. Herald added a project: All. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Although the default behaviour for C and C++ is to not

[PATCH] D129835: [clang] adds a discardable attribute

2022-07-14 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 444890. cjdb added a comment. undoes editor autotrimming of spaces Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129835/new/ https://reviews.llvm.org/D129835 Files: clang/docs/ReleaseNotes.rst clang/include/c

[PATCH] D129835: [clang] adds a discardable attribute

2022-07-15 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a subscriber: ldionne. cjdb added a comment. In D129835#3655487 , @aaron.ballman wrote: >> When we have a function that can have its value discarded, we can use >> [[clang::discardable]] to indicate that the `[[nodiscard]]` attribute should

[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif for SARIF diagnostics

2022-07-15 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Thanks for getting this started! To get this ready for submission, would you be able to add a test please? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129886/new/ https://reviews.llvm.org/D129886 __

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added a reviewer: aaron.ballman. Herald added a project: All. cjdb requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Per per [range.iter.ops]/2 and [algorithms.requirements]/2, functions declared in the namesp

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 445285. cjdb added a comment. moves test from Sema to SemaCXX I Noticed that SemaCXX is only a test directory, and that there's no corresponding SemaCXX in either include or lib. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revie

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 445286. cjdb edited the summary of this revision. cjdb added a comment. updates an inaccuracy in the commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129951/new/ https://reviews.llvm.org/D129951 Files

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-16 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. Looking at the output from Clang 14 , I'm observing that a binary with 178 function templates is 13% the size of the one with 89 function objects. When only one function object is used vs all 178 function templates, the functions still win

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-17 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D129951#3657923 , @cjdb wrote: > ~~Looking at the output from Clang 14 , I'm > observing that a binary with 178 function templates is 13% the size of the > one with 89 function objects. When only

[PATCH] D129951: [clang] teaches Clang the special ADL rules for functions in std::ranges

2022-07-17 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9438 // FIXME: Pass in the explicit template arguments? ArgumentDependentLookup(Name, Loc, Args, Fns); rsmith wrote: > It would seem preferable to me to do the filtering in > `Argume

[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif option for future SARIF output

2022-07-18 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:684 + "diagnostic formatting in SARIF mode is currently unstable">, + InGroup>; } abrahamcd wrote: > Please let me know if there's a better warning group you think this

[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif option for future SARIF output

2022-07-19 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. This revision is now accepted and ready to land. Thanks for working on this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129886/new/ https://reviews.llvm.org/D129886

[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif option for future SARIF output

2022-07-19 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4009-4011 +if (StringRef(A->getValue()) == "sarif") { + D.Diag(diag::warn_drv_sarif_format_unstable); +} aaron.ballman wrote: > Do we want to be kind to people who spell it

[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif option for future SARIF output

2022-07-21 Thread Christopher Di Bella via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG119d22310bd6: [clang] Add -fdiagnostics-format=sarif option for future SARIF output (authored by abrahamcd, committed by cjdb). Repository: rG LLV

[PATCH] D125078: Implement a feature to show line numbers in diagnostics

2022-05-09 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added subscribers: rsmith, cjdb. cjdb added a comment. I'm in favour of this, but @rsmith warned me a little while ago that we mightn't be able to have stuff like this on by default because scripts probably depend on specific compiler output. Hyrum's Law strike

[PATCH] D125078: Implement a feature to show line numbers in diagnostics

2022-05-10 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. I support turning it on by default. I'm simply passing on the message. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125078/new/ https://reviews.llvm.org/D125078 ___ cfe-commits mai

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-05-13 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:4155 +#undef TRANSFORM_TYPE_TRAIT_DEF + if (!ParseTypeTransformTypeSpecifier(DS)) +goto ParseIdentifier; rsmith wrote: > The name signature you're using for this function is incons

[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

2022-05-13 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/test/SemaCXX/type-traits.cpp:3495-3496 + + { int a[T(__is_same(make_signed_t, int))]; } + { int a[T(__is_same(make_signed_t, int))]; } + { int a[T(__is_same(make_signed_t, const int))]; } cjdb wrote: > rsmith wrote

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-05-13 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 429410. cjdb added a comment. makes `__is_destructible` and `__is_nothrow_destructible` `KEYCXX` instead of `KEYMS` (attention @aaron.ballman) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116280/new/ https://rev

[PATCH] D116280: [clang] adds unary type trait checks as compiler built-ins

2022-05-14 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 429479. cjdb added a comment. rebases for D116203 's sake Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116280/new/ https://reviews.llvm.org/D116280 Files: clang/include/clang/

[PATCH] D92176: Don't use sysroot/include when sysroot is empty.

2020-12-01 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added a comment. In D92176#2419011 , @manojgupta wrote: > lgtm but not an expert in this area. Ditto Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92176/new/ https://reviews.llvm.org/D92176 _

[PATCH] D102728: [clang][Sema] removes -Wfree-nonheap-object reference param false positive

2021-05-18 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb created this revision. cjdb added reviewers: gbiv, manojgupta, aaron.ballman. Herald added a reviewer: george.burgess.iv. Herald added subscribers: dcaballe, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-j

[PATCH] D103380: [C++20] Support for lambdas in unevaluated context

2021-05-30 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb requested changes to this revision. cjdb added a comment. This revision now requires changes to proceed. Thanks for working on this, it'll be a huge win for testing in libc++, methinks! Could we get a few more tests please? I'd like to know what happens when we put a lambda directly inside:

[PATCH] D103380: [C++20] Support for lambdas in unevaluated context

2021-05-31 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb accepted this revision. cjdb added a comment. This revision is now accepted and ready to land. LGTM, but I'm neither a Clang nor core expert (and I'm not a maintainer), so please wait for others' approval. Comment at: clang/test/CXX/expr/expr.prim/expr.prim.lambda/p2-unev

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-08 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 38. cjdb marked 4 inline comments as done. cjdb added a comment. Herald added a subscriber: cfe-commits. addresses comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94640/new/ https://reviews.llvm.org/D94

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-08 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:10267-10277 + if (const auto *Field = dyn_cast(D)) { S.Diag(UnaryExpr->getBeginLoc(), diag::warn_free_nonheap_object) << CalleeName << Field; +return; + } + + if (const auto *Func = dyn_c

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-11 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb added inline comments. Comment at: clang/test/Analysis/free.c:84 + // expected-warning@-1{{Argument to free() is a block, which is not memory allocated by malloc()}} + // expected-warning@-2{{attempt to call free on non-heap object : block expression}} } ---

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-12 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 323414. cjdb added a comment. fixes block expressions @aaron.ballman I'm not sure I follow what you're after re lambdas. Could you please provide a test case that I can work with? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-12 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked 3 inline comments as done. cjdb added inline comments. Comment at: clang/test/Analysis/free.c:84 + // expected-warning@-1{{Argument to free() is a block, which is not memory allocated by malloc()}} + // expected-warning@-2{{attempt to call free on non-heap object :

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-22 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked an inline comment as done. cjdb added a comment. Ping. @aaron.ballman any further requests? I think this is good to land otherwise? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94640/new/ https://reviews.llvm.org/D94640 _

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-23 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb marked an inline comment as done. cjdb added a comment. In D94640#2579447 , @aaron.ballman wrote: > In D94640#2560647 , @cjdb wrote: > >> fixes block expressions >> >> @aaron.ballman I'm not sure I follow what

[PATCH] D94640: adds more checks to -Wfree-nonheap-object

2021-02-23 Thread Christopher Di Bella via Phabricator via cfe-commits
cjdb updated this revision to Diff 325889. cjdb added a comment. applies @aaron.ballman's feedback Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94640/new/ https://reviews.llvm.org/D94640 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

  1   2   3   4   5   >