[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Ross Kirsling via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Ross Kirsling via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-14 Thread Ross Kirsling via cfe-commits
rkirsling wrote: (This seems to be an intermittent existing failure.) https://github.com/llvm/llvm-project/pull/144069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix typo in is_replaceable diagnostic (PR #144247)

2025-06-14 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling created https://github.com/llvm/llvm-project/pull/144247 Adjustment to #143265; `because it not` should be `because it is not`. >From 9bd2d17ddcbcdfaf4236ce4e4eadf0f5724a478e Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Sat, 14 Jun 2025 21:42:47 -0700 Subject

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-13 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144069 >From be121c500684e971ad696be8d53db732665d851c Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Fri, 13 Jun 2025 21:51:25 +0900 Subject: [PATCH 1/3] [Clang] Fix fix-it hint regression from #143460 `:` began

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-13 Thread Ross Kirsling via cfe-commits
rkirsling wrote: @AaronBallman Looks like this is the PR we're going with after all—could I have you merge it for me? Thanks! :bow: https://github.com/llvm/llvm-project/pull/144069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Ross Kirsling via cfe-commits
rkirsling wrote: Ohh, you beat me by a minute. 😆 I can close #144069 then. https://github.com/llvm/llvm-project/pull/144068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] fix missing source location for errors in macro-expanded (PR #143460)

2025-06-13 Thread Ross Kirsling via cfe-commits
@@ -832,10 +832,13 @@ StmtResult Parser::ParseCaseStatement(ParsedStmtContext StmtCtx, << "'case'" << tok::colon << FixItHint::CreateReplacement(ColonLoc, ":"); } else { - SourceLocation ExpectedLoc = PP.getLocForEndOfToken(PrevTokLocation); +

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-13 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling created https://github.com/llvm/llvm-project/pull/144069 Following #143460, `:` began displaying as `colon` in the fix-it hint for a `case` with a missing colon, as is visible in the description of (the separate bug) #144052. This PR simply reverts a line that did

[clang] [Clang] Fix fix-it hint regression from #143460 (PR #144069)

2025-06-13 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144069 >From be121c500684e971ad696be8d53db732665d851c Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Fri, 13 Jun 2025 21:51:25 +0900 Subject: [PATCH 1/2] [Clang] Fix fix-it hint regression from #143460 `:` began

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Ross Kirsling via cfe-commits
rkirsling wrote: I believe I'd need somebody to hit the merge button for me regardless, so I think we can just merge whichever one and close the other. 😅 The two approaches are mostly the same, I just figured that the surrounding code was consistent in using a literal `":"`, while there doesn'

[clang] [Clang] use colon char instead of token name (PR #144068)

2025-06-13 Thread Ross Kirsling via cfe-commits
rkirsling wrote: Oh oops! Thanks for the correction. https://github.com/llvm/llvm-project/pull/144068 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-19 Thread Ross Kirsling via cfe-commits
@@ -99,6 +127,14 @@ static_assert(std::is_trivially_copyable_v); // expected-note@-1 {{'int &' is not trivially copyable}} \ // expected-note@-1 {{because it is a reference type}} +static_assert(std::is_assignable::value); + +static_assert(std::is_assignable::value); +// expec

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-19 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling edited https://github.com/llvm/llvm-project/pull/144836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix typo in is_replaceable diagnostic (PR #144247)

2025-06-15 Thread Ross Kirsling via cfe-commits
rkirsling wrote: @ojhunt Thanks! Could you hit the green button for me as well? https://github.com/llvm/llvm-project/pull/144247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-19 Thread Ross Kirsling via cfe-commits
rkirsling wrote: Seems like I don't have the ability to add reviewers yet; pinging @cor3ntin and @AaronBallman for visibility. https://github.com/llvm/llvm-project/pull/144836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[clang] [libcxx] [libc++][Clang] Added explanation why is_constructible evaluated to false. Updated the diagnostics checks in libc++ tests. (PR #144220)

2025-06-18 Thread Ross Kirsling via cfe-commits
@@ -1767,7 +1767,8 @@ def note_unsatisfied_trait : Note<"%0 is not %enum_select{" "%TriviallyRelocatable{trivially relocatable}|" "%Replaceable{replaceable}|" - "%TriviallyCopyable{trivially copyable}" + "%TriviallyCopyable{triviall

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-18 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling created https://github.com/llvm/llvm-project/pull/144836 Part of the work for #141911. Checking `is_assignable` boils down to checking the well-formedness of `declval() = declval()`; this PR recycles logic from EvaluateBinaryTypeTrait in order to produce the relev

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-18 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144836 >From 580750339643b627552a1c726909dd5d12f3c9af Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Wed, 18 Jun 2025 21:54:35 -0700 Subject: [PATCH] [Clang] Diagnose unsatisfied `std::is_assignable`. Part of th

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-24 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144836 >From 580750339643b627552a1c726909dd5d12f3c9af Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Wed, 18 Jun 2025 21:54:35 -0700 Subject: [PATCH 1/3] [Clang] Diagnose unsatisfied `std::is_assignable`. Part o

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-24 Thread Ross Kirsling via cfe-commits
https://github.com/rkirsling updated https://github.com/llvm/llvm-project/pull/144836 >From 580750339643b627552a1c726909dd5d12f3c9af Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Wed, 18 Jun 2025 21:54:35 -0700 Subject: [PATCH 1/2] [Clang] Diagnose unsatisfied `std::is_assignable`. Part o

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-24 Thread Ross Kirsling via cfe-commits
@@ -1725,14 +1725,15 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, // Build expressions that emulate the effect of declval() and // declval(). -if (LhsT->isObjectType() || LhsT->isFunctionType()) - LhsT = Self.Context.getRValueReferenceTyp

[clang] [Clang] Diagnose unsatisfied `std::is_assignable`. (PR #144836)

2025-06-24 Thread Ross Kirsling via cfe-commits
@@ -2285,6 +2286,31 @@ static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef, SemaRef.Diag(D->getLocation(), diag::note_defined_here) << D; } +static void DiagnoseNonAssignableReason(Sema &SemaRef, SourceLocation Loc, +QualType