[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-07-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 536743. hazohelet edited the summary of this revision. hazohelet added a comment. Edited release note so that it only mentions the clang 16 -> 17 changes, and not development internal ones CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153359/new/

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-07-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 536771. hazohelet edited the summary of this revision. hazohelet added a comment. - Removed the `base class inherited here` redundant note - Provided source range and added test for it The provided source range is NOT directly calling `CXXBaseSpecifier::ge

[PATCH] D154366: [clang][ExprConstant] Print template arguments when describing stack frame

2023-07-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, cjdb, shafik. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch adds additional printing of template argument list when the described function is a

[PATCH] D154366: [clang][ExprConstant] Print template arguments when describing stack frame

2023-07-06 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. `FunctionDecll::getNameForDiagnostic` yields almost the same result and I should use it here. This function internal avoids printing template args that match the defaults, but it doesn't seem to have other techniques to reduce the size of printing. Link: https://githu

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D152495#4481588 , @aaron.ballman wrote: > This is a bit of an odd situation -- the condition variable *is* used (e.g., > its value is loaded to determine whether to go into the if branch or the else > branch), so we should

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 538591. hazohelet marked 5 inline comments as done. hazohelet added a comment. - Stop marking condition variable declarations as unused and diagnose all `VarDecl` that is marked used but not referenced - Added test not to warn when the declaration is not ag

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-07-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153969/new/ https://reviews.llvm.org/D153969 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-07-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 538754. hazohelet marked 3 inline comments as done. hazohelet added a comment. Address comments from aaron.ballman - Added more tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153969/new/ https://reviews.llvm.org/D153969 Files: clang/docs/

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-07-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2422 + << BS.getType(); + Info.Note(BS.getBeginLoc(), diag::note_constexpr_base_inherited_here); + return false; aaron.ballman wrote: > hazohelet wrote: >

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-07-12 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, rsmith, cor3ntin, erichkeane, tbaeder. Herald added a project: All. hazohelet requested review of this revision. Herald added projects: clang, libc++. Herald added a subscriber: libcxx-commits. Herald added a reviewer: libc+

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4016-4019 + // Ensure that `-Wunused-variable` will be emitted for condition variables + // that are not referenced later. e.g.: if (int var = init()); + if

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-07-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 540029. hazohelet edited the summary of this revision. hazohelet added a comment. Address comments from Corentin, Mark and Nikolas - Removed `InConstantEvaluated` - Removed `RuntimeEvaluated` expression evaluation context kind and instead added a boolean `

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-07-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked 9 inline comments as done. hazohelet added a comment. Thank you for the review! Comment at: clang/include/clang/Sema/Sema.h:1277 +/// as PotentiallyEvaluated. +RuntimeEvaluated }; cor3ntin wrote: > I think I'd prefer a boolean for th

[PATCH] D152093: [clang][Analysis] Handle && and || against variable and its negation as tautology

2023-07-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. > Do you have any numbers on how often this fires in practice, and what the > true positive rate is? (Build some large-ish open source project with this, > and see what it finds.) I built rui314/mold and saw no new warnings emitted from this change. I searched sever

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-07-14 Thread Takuya Shimizu 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 rG176981ac58d3: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes (authored by hazohelet). Changed prior to commit: https://rev

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 540479. hazohelet marked 6 inline comments as done. hazohelet added a comment. Address comments from Aaron and Corentin - Call `ConditionVar->setReferenced(false)` without any checks - Added some more tests CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4016-4019 + // Ensure that `-Wunused-variable` will be emitted for condition variables + // that are not referenced later. e.g.: if (int var = init()); + if (!T->isAggregateType()) +ConditionVar->s

[PATCH] D154366: [clang][ExprConstant] Print template arguments when describing stack frame

2023-07-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 540486. hazohelet added a comment. Uses `FunctionDecl::getNameForDiagnostic` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154366/new/ https://reviews.llvm.org/D154366 Files: clang/docs/ReleaseNotes.rst clang/lib/AST/ExprConstant.cpp clang/

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-07-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4016-4019 + // Ensure that `-Wunused-variable` will be emitted for condition variables + // that are not referenced later. e.g.: if (int var = init()); + if (!T->isAggregateType()) +ConditionVar->s

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-07-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: clang/lib/Parse/ParseDecl.cpp:2440 +S.ExprEvalContexts.back().Context; +if ((D.getDeclSpec().getTypeQualifiers() == DeclSpec::TQ_const || + isNonlocalVariable(

[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

2023-08-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 552939. hazohelet marked 4 inline comments as done. hazohelet added a comment. Address review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158562/new/ https://reviews.llvm.org/D158562 Files: clang/docs/ReleaseNotes.rst clang/include

[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

2023-08-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Gcc can diagnose wider cases of overflow/truncation by specifying a higher level for it, like `-Wformat-overflow=2` (https://godbolt.org/z/n5facjW1c). The current clang counterpart only diagnoses when the format string is //always// larger than the buffer size. If we

[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

2023-08-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D158562#4614835 , @aaron.ballman wrote: > Thank you for working on this! > > Precommit CI found an issue with libc++'s tests: > https://reviews.llvm.org/harbormaster/unit/view/8606248/ -- it'd be best if > those could be a

[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

2023-08-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 553246. hazohelet added a comment. Fixes `EstimateSizeFormatHandler`'s `%g` handling. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158562/new/ https://reviews.llvm.org/D158562 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/Diag

[PATCH] D157855: [clang][ExprConstant] Improve error message of compound assignment against uninitialized object

2023-08-25 Thread Takuya Shimizu 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 rG615d812696ee: [clang][ExprConstant] Improve error message of compound assignment against… (authored by hazohelet). Changed prior to commit: https:

[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

2023-08-25 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0c9c9dd9a24f: [clang][Sema] Add truncation warning on fortified snprintf (authored by hazohelet). Changed prior to commit: https://reviews.llvm.org/D158562?vs=553246&id=553702#toc Repository: rG LLVM

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-08-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/ https://reviews.llvm.org/D155064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D158472: [clang][Diagnostics] Emit fix-it hint separately on overload resolution failure

2023-08-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158472/new/ https://reviews.llvm.org/D158472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D159138: [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

2023-08-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, nickdesaulniers, serge-sans-paille. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. The wrong handling of %x specifier with alternative form causes a false positive

[PATCH] D158016: [NFC] Remove unused variables declared in conditions

2023-08-29 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG01b88dd66d9d: [NFC] Remove unused variables declared in conditions (authored by hazohelet). Changed prior to commit: https://reviews.llvm.org/D158016?vs=550438&id=554538#toc Repository: rG LLVM Githu

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-08-29 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG92023b150990: Reland "[Clang][SemaCXX] Add unused warning for variables declared in condition… (authored by hazohelet). Changed prior to commit: https://reviews.llvm.org/D152495?vs=550443&id=554539#toc

[PATCH] D159138: [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

2023-08-30 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:966 +// size. e.g.(("%#3x", 0xf) is "0xf") + +// If the result is zero, o, b, x, X adds nothing. serge-sans-paille wrote: > Th

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-08-30 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D153690#4624726 , @michael-jabbour-sonarsource wrote: > The removal of the early return in this patch causes a crash when parsing the > following example: > > struct S { > bool operator==(int) const; > }; > > v

[PATCH] D159138: [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

2023-08-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 555043. hazohelet marked an inline comment as done. hazohelet added a comment. Added `%X` and `%o` tests, which are also affected CHANGES SINCE LAST ACTION https://reviews.llvm.org/D159138/new/ https://reviews.llvm.org/D159138 Files: clang/docs/Relea

[PATCH] D159138: [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

2023-08-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D159138#4628858 , @nickdesaulniers wrote: > Mind adding tests for `%#X` and `%#o` as well, since you're changing the > behavior of those, too? > > I think it would also be good to have explicit tests for `%o` and `%b` where

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-08-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Thank you for the feedback and the revert! Distinguishing condition variables from other unused variables in Wunused warnings was something I was trying initially, and I agree that it's the best way forward. The difficulty is in how to know whether an unused `VarDecl`

[PATCH] D159138: [clang][Sema] Fix format size estimator's handling of %o, %x, %X with alternative form

2023-08-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/test/Sema/warn-fortify-source.c:100-102 + __builtin_snprintf(buf, 2, "%#x", n); + __builtin_snprintf(buf, 2, "%#X", n); + __builtin_snprintf(buf, 2, "%#o", n); nickdesaulniers wrote: > Note that GCC -Wformat-t

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-09-04 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. I submitted PR to fix the crash: https://github.com/llvm/llvm-project/pull/65248 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153690/new/ https://reviews.llvm.org/D153690 ___

[PATCH] D155064: [clang][SemaCXX] Diagnose tautological uses of consteval if and is_constant_evaluated

2023-09-04 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/ https://reviews.llvm.org/D155064 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D158472: [clang][Diagnostics] Emit fix-it hint separately on overload resolution failure

2023-09-05 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158472/new/ https://reviews.llvm.org/D158472 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D155610: [Clang][Sema] Fix display of characters on static assertion failure

2023-09-06 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. @cor3ntin Gentle ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155610/new/ https://reviews.llvm.org/D155610 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D157526: [clang][Sema] Remove irrelevant diagnostics from constraint satisfaction failure

2023-09-06 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. To generate only the necessary diagnostic information, we need to know the evaluation result of the entire constraint expression. So, the ideal way I can think of would be first to evaluate the nodes and, simultaneously, cache the results using `DenseMap` or something,

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-18 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, shafik. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch improves the diagnostic on uninitialized subobjects in constexpr variables by modifying t

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 506358. hazohelet added a comment. Address comments from @shafik and @tbaeder CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146358/new/ https://reviews.llvm.org/D146358 Files: clang/include/clang/Basic/DiagnosticASTKinds.td clang/lib/AST/Expr

[PATCH] D142800: [Clang][Diagnostic] Add `-Wcomparison-op-parentheses` to warn on chained comparisons

2023-03-21 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 506887. hazohelet added a comment. Herald added a subscriber: jplehr. Rebase and Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142800/new/ https://reviews.llvm.org/D142800 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/Diag

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D146358#4227938 , @cjdb wrote: > In D146358#4204412 , @tbaeder wrote: > >> "subobject named 'foo'" sounds a bit weird to me, I'd expect just "subobject >> 'foo'", but that's just a s

[PATCH] D142800: [Clang][Diagnostic] Add `-Wcomparison-op-parentheses` to warn on chained comparisons

2023-03-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 502166. hazohelet added a comment. Update the differential - Revise warning messages based on ideas from @aaron.ballman. - Introduce a new warning flag `-Wchaining-comparisons` that is enabled by default, to warn about chaining relationals or equal operato

[PATCH] D142800: [Clang][Diagnostic] Add `-Wcomparison-op-parentheses` to warn on chained comparisons

2023-03-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D142800#4165090 , @aaron.ballman wrote: > In D142800#4104241 , @hazohelet > wrote: > >>> Also, why are these diagnostics off by default? Do we have some idea as to >>> the false po

[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call

2023-03-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: tbaeder, cjdb, aaron.ballman. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch improves diagnostic for clang constexpr evaluator by adding a check for `nullptr` in functi

[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call

2023-03-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:7673 +Info.FFDiag(Callee, diag::note_constexpr_null_callee) +<< const_cast(Callee); +return false; tbaeder wrote: > Is the `const_cast` really necessary? > Is

[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call

2023-03-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504324. hazohelet edited the summary of this revision. hazohelet added a comment. Address comment from @aaron.ballman - Rewording the diagnostic CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145793/new/ https://reviews.llvm.org/D145793 Files:

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-11 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: tbaeder, aaron.ballman, cjdb. Herald added a reviewer: NoQ. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch checks whether `-Wunreachable-code-fallthrough` is enabled whe

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-12 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504501. hazohelet added a comment. Address comments from @shafik - Pass bool flag `UnreachableFallThroughDiagIsEnabled` instead of `DiagnosticsEngine` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145842/new/ https://reviews.llvm.org/D145842 Fi

[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504678. hazohelet added a comment. Added a release note CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145793/new/ https://reviews.llvm.org/D145793 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticASTKinds.td clang/lib/

[PATCH] D145793: [clang][AST] Improve diagnostic for `nullptr` constexpr function pointer call

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D145793#4189252 , @aaron.ballman wrote: > LGTM, though please add a release note for the fix. If you need someone to > land on your behalf, let us know what name and email address you'd like used > for patch attribution.

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504697. hazohelet added a comment. Address comments from @aaron.ballman - Dropped `const` qualifier from value objects for style consistency - Passed boolean `HasFallThroughAttr` to callback and handled warning suppression in `HandleUnreachable` in order t

[PATCH] D145842: [clang][Sema] Avoid duplicate diagnostics for unreachable fallthrough attribute

2023-03-13 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 504933. hazohelet added a comment. Address comments from @aaron.ballman - NFC stylistic changes Thanks for the review! Since I don't have commit access, would you please land this patch for me? Please use "Takuya Shimizu " for the patch attribution. CHA

[PATCH] D152548: [Clang][Interp] Diagnose uninitialized ctor of global record arrays

2023-06-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 532554. hazohelet marked an inline comment as done. hazohelet added a comment. Address comment from @tbaeder - NFC stylistic change in test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152548/new/ https://reviews.llvm.org/D152548 Files: clang

[PATCH] D152093: [clang][Analysis] Handle && and || against variable and its negation as tautology

2023-06-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 532557. hazohelet marked an inline comment as done. hazohelet added a comment. Address review comment - NFC stylistic change CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152093/new/ https://reviews.llvm.org/D152093 Files: clang/docs/ReleaseNo

[PATCH] D153267: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes

2023-06-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, cjdb, erichkeane. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. On mismatch of arity of functions like void func( int aa, int bb) {} void callsite() {

[PATCH] D152495: [Clang][SemaCXX] Add unused warning for variables declared in condition expressions

2023-06-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152495/new/ https://reviews.llvm.org/D152495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-20 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, cjdb, shafik. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. Now that clang supports printing of multiple lines of code snippet in diagnostics, source rang

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-20 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 533142. hazohelet added a comment. Address comments from @tbaeder - Bind parameter source range rather than its declaration to variable. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153359/new/ https://reviews.llvm.org/D153359 Files: clang/li

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-20 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked 2 inline comments as done. hazohelet added a comment. Consider the following code. (I added another parameter to the original code so that the covered range becomes clearer) void func(int aa, int bb); void test() { func(1, "two"); } BEFORE this patch: source:4:15:

[PATCH] D152548: [Clang][Interp] Diagnose uninitialized ctor of global record arrays

2023-06-21 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdfb85c3ce09a: [Clang][Interp] Diagnose uninitialized ctor of global record arrays (authored by hazohelet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1525

[PATCH] D152796: [clang][Sema] Fix diagnostic message for unused constant varialbe templates

2023-06-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1385 + Diag(DiagD->getLocation(), diag::warn_unused_template) + << /*variable*/ 1 << DiagD; } else if (DiagD->getType().isConstQualified

[PATCH] D151720: [clang][ExprConstant] Fix display of syntactically-invalid note for member function calls

2023-06-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 533964. hazohelet added a comment. Address review comment NFC - make some arguments conform to bugprone-argument-comments - edit release note text CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151720/new/ https://reviews.llvm.org/D151720 Files:

[PATCH] D151720: [clang][ExprConstant] Fix display of syntactically-invalid note for member function calls

2023-06-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked 4 inline comments as done. hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:983 EnableNewConstInterp(C.getLangOpts().EnableNewConstInterp), - BottomFrame(*this, SourceLocation(), nullptr, nullptr, CallRef()), +

[PATCH] D153267: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes

2023-06-23 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 533971. hazohelet marked an inline comment as done. hazohelet edited the summary of this revision. hazohelet added a comment. Address comments from @cjdb and @aaron.ballman - Remove unnecessary cast to void in test - Add release note CHANGES SINCE LAST AC

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-06-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, cjdb, tbaeder, efriedma, rnk. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. D120936 has made the loss of `__unaligned` qualifier

[PATCH] D153267: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes

2023-06-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D153267#4445417 , @cjdb wrote: > Thanks! This LGTM now. Do you need assistance with merging? Thanks for the review! I have commit access now, so I'll be landing this myself. CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:10821 +// FIXME: No test case for this. Can we remove this block? if (FromQs.hasUnaligned() != ToQs.hasUnaligned()) { cjdb wrote: >

[PATCH] D153267: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes

2023-06-25 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG409a8097c5c7: [clang][Diagnostics] Provide parameter source range to arity-mismatch notes (authored by hazohelet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D152093: [clang][Analysis] Handle && and || against variable and its negation as tautology

2023-06-26 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152093/new/ https://reviews.llvm.org/D152093 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-06-27 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Ah looking at the code again, I noticed this change is not NFC. This suppresses inappropriate diagnostics (example added in summary). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153690/new/ https://reviews.llvm.org/D15

[PATCH] D151720: [clang][ExprConstant] Fix display of syntactically-invalid note for member function calls

2023-06-27 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hazohelet marked an inline comment as done. Closed by commit rGf6be96aa4e5e: [clang][ExprConstant] Fix display of syntactically-invalid note for member… (authored by hazohelet). Changed prior to commit: https://reviews.ll

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-06-27 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 535010. hazohelet added a comment. Added release note and test because this change is not NFC CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153690/new/ https://reviews.llvm.org/D153690 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Ba

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-06-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D153690#4453001 , @cjdb wrote: > Excellent, thanks! LGTM, do you need assistance with merging? Thanks for the review. I'll land this myself. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153690/new/ https://review

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-06-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, erichkeane, shafik, tbaeder. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch fixes the reported regression caused by D146358

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-06-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2379 if (!Value.hasValue()) { assert(SubobjectDecl && "SubobjectDecl shall be non-null"); Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << SubobjectDecl; The reaso

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 535433. hazohelet marked an inline comment as done. hazohelet edited the summary of this revision. hazohelet added a comment. Removed FIXME comment that is already addressed in D153690 CHANGES SINCE LAST ACTION https:/

[PATCH] D153690: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier

2023-06-29 Thread Takuya Shimizu 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 rG8038086aa75a: [clang][Sema] Remove dead diagnostic for loss of __unaligned qualifier (authored by hazohelet). Repository: rG LLVM Github Monorepo

[PATCH] D153359: [clang][Diagnostics] Fix distant source ranges in bad-conversion notes

2023-06-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 535801. hazohelet edited the summary of this revision. hazohelet added a comment. Address comment from cjdb - Added example code & before/after diagnostic display to release note Thanks for reminding! CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-06-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2422 + << BS.getType(); + Info.Note(BS.getBeginLoc(), diag::note_constexpr_base_inherited_here); + return false; tbaeder wrote: > Can you pass `<< BS.getSo

[PATCH] D153969: [clang][ExprConstant] Fix crash on uninitialized base class subobject

2023-06-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2422 + << BS.getType(); + Info.Note(BS.getBeginLoc(), diag::note_constexpr_base_inherited_here); + return false; hazohelet wrote: > tbaeder wrote: > > Can

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-29 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D146358#4230122 , @simideveloper wrote: > hey, I was working on the same issue so can we collaborate on this issue? @simideveloper Thanks for your interest in collaborating on this issue, and sorry if I discouraged you fro

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-30 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. @aaron.ballman Thanks for the review! I'll add a release note. Comment at: clang/lib/AST/ExprConstant.cpp:2357-2361 +if (SubobjectDecl) { + Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << SubobjectDecl; + Info.Note(Subobjec

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-03-30 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 509686. hazohelet added a comment. Added release note CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146358/new/ https://reviews.llvm.org/D146358 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticASTKinds.td clang/lib/AS

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-07 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2357-2361 +if (SubobjectDecl) { + Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << SubobjectDecl; + Info.Note(SubobjectDecl->getLocation(), +diag::note_constexpr_

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-07 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 511659. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146358/new/ https://reviews.llvm.org/D146358 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticASTKinds.td clang/lib/AST/ExprConstant.cpp clang/lib/AST/Interp/Interp

[PATCH] D148419: [clang][AST] Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluation failure

2023-04-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: rsmith, tbaeder, shafik, aaron.ballman. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch fixes the wrong signal from the constexpr evaluator that `[[gnu::weak]]` member p

[PATCH] D148419: [clang][AST] Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluation failure

2023-04-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 514179. hazohelet added a comment. Address comments from @aaron.ballman - Added release note - Do not specify std c++ version in test code CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148419/new/ https://reviews.llvm.org/D148419 Files: clang/

[PATCH] D148419: [clang][AST] Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluation failure

2023-04-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added a comment. In D148419#4273551 , @aaron.ballman wrote: > LGTM, though the changes need a release note. Do you still need someone to > commit on your behalf? (Alternatively, you could consider re

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D146358#4268327 , @tbaeder wrote: > So, if I understand the code correctly, we call `CheckEvaluationResult` with > `SubObjectDecl=nullptr` when we're not checking an actual field but just an > array/record, so we can't run

[PATCH] D148419: [clang][AST] Constexpr evaluator should treat [[gnu::weak]] member pointer comparisons as evaluation failure

2023-04-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added a comment. @aaron.ballman Sorry, this change is breaking the buildbot and because I don't have commit access I would like you to revert it for me. It seems we need to specify the std option in the test code. BUILD FAILED: 41435 expec

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-04-17 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 514252. hazohelet added a comment. Remove `gnu::weak` diff CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146358/new/ https://reviews.llvm.org/D146358 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticASTKinds.td clang/l

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-05-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D146358#4352792 , @erichkeane wrote: > In D146358#4351787 , @hazohelet > wrote: > >> In D146358#4350810 , @erichkeane >> wrote: >> >>> Our

[PATCH] D151033: [clang][AST] TextNodeDumper should not evaluate the initializer of constexpr variable template definition

2023-05-20 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, erichkeane, tbaeder. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. `TextNodeDumper` enabed through `-ast-dump` flag should not evlauate the initializer when it vis

[PATCH] D146358: [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables

2023-05-20 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D146358#4357276 , @erichkeane wrote: > In D146358#4357106 , @hazohelet > wrote: > >> Thanks for the revert! >> >> It seems that the problem is around the list initializer in templat

[PATCH] D151033: [clang][AST] TextNodeDumper should not evaluate the initializer of constexpr variable template definition

2023-05-21 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D151033#4359121 , @tbaeder wrote: > Can you briefly explain why the `FieldDecl` we see is null in that case? Consider `template constexpr T foo{};` `evaluateValue` here leads to a call of `EvaluateAsInitializer`. It calls

<    1   2   3   >