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

2023-10-03 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2176c5e510e3: [Clang][Sema] Fix display of characters on static assertion failure (authored by hazohelet). Changed prior to commit: https://reviews.llvm.org/D155610?vs=557524=557581#toc Repository:

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

2023-10-02 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 557524. hazohelet added a comment. Address comments from Corentin CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155610/new/ https://reviews.llvm.org/D155610 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/Diagnostic.h

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

2023-10-02 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D155610#4652198 , @cor3ntin wrote: > @hazohelet Please keep this patch on Phab. It's not going to be shutdown. The > current consensus is that we will reconsider shutting down phab on November 15 >

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

2023-09-30 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet abandoned this revision. hazohelet added a comment. Thank you so much to everyone for guiding this patch onto the right track! I'll submit GitHub PR after making suggested changes. Since Phabricator is going to be shutdown, I mark this differential as abandoned. CHANGES SINCE LAST

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

2023-09-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Thank you for the revert! This looks like a general issue of clang on template deduction in constant-evaluated context (https://godbolt.org/z/zTro7Ycfa). Pushing constant-evaluated context against initializer of instantiated constexpr variables made this bug appear

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

2023-09-27 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Thanks for the report about the errors in lambdas. The culprit is `clang/lib/Sema/SemaTemplateInstantiateDecl.cpp`. I am pushing constant-evaluated context if the instantiated variable is constexpr variable, and somehow it causes those errors. I'll take deeper look

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

2023-09-27 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D155064#4651306 , @hans wrote: > We saw a new warning in Chromium after this, and I wasn't sure if that's > intentional: > > #include > > template float foo(T input) { > if (sizeof(T) > 2) { > return 42;

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

2023-09-26 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 rG491b2810fb7f: [clang][SemaCXX] Diagnose tautological uses of consteval if and… (authored by hazohelet). Changed prior to commit:

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

2023-09-18 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 556946. hazohelet added a comment. After discussion in https://github.com/llvm/llvm-project/pull/66222, I noticed I had misunderstood the recursiveness of constant-evaluated context. I was pushing constant-evaluating on the lambda body when it appears

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

2023-09-18 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 rGb2cd9db58933: [clang][Sema] Remove irrelevant diagnostics from constraint satisfaction failure (authored by hazohelet). Changed prior to commit:

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

2023-09-18 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet abandoned this revision. hazohelet added a comment. In D158472#4645378 , @aaron.ballman wrote: > In D158472#4605228 , @hazohelet > wrote: > >> This breaks the one-note-for-one-overload-candidate rule

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

2023-09-13 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-09-11 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. hazohelet marked an inline comment as done. Closed by commit rG72f6abb9bca6: [clang][Sema] Fix format size estimators handling of %o, %x, %X with… (authored by

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

2023-09-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. When I first ran `git clang-format` locally, it somehow forced 4-space indent. After starting to use clang-format from the trunk, I haven't seen the suspicious behavior locally, but the CI format check failure might be caused by that. The format seems okay as-is, so

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

2023-09-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked 4 inline comments as done. hazohelet added a comment. Thanks for the review! Comment at: clang/docs/ReleaseNotes.rst:125 * ``-Woverriding-t-option`` is renamed to ``-Woverriding-option``. * ``-Winterrupt-service-routine`` is renamed to

[PATCH] D156045: [clang][Interp] Enable existing source_location tests

2023-09-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. @tbaeder Now it's working correctly. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156045/new/ https://reviews.llvm.org/D156045 ___ cfe-commits mailing list

[PATCH] D156045: [clang][Interp] Enable existing source_location tests

2023-09-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. I was rebasing D155064 locally and saw test failures for the new interpreter in this file. The cause seems to me that the new interpreter is not handling some cases of `SourceLocExpr` correctly when they appear inside

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

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

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

2023-09-07 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 556227. hazohelet marked an inline comment as done. hazohelet added a comment. Added comment and FIXME CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157526/new/ https://reviews.llvm.org/D157526 Files: clang/docs/ReleaseNotes.rst

[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

[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

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

[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

[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`

[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:

[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; > }; > >

[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: >

[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=554539#toc

[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=554538#toc Repository: rG LLVM Github

[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] 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] 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] 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=553702#toc Repository: rG LLVM

[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:

[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

[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

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

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

2023-08-22 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, serge-sans-paille, nickdesaulniers, tbaeder. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. This patch warns on `snprintf` calls whose `n` argument is known to be

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

2023-08-22 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 552417. hazohelet added a comment. Herald added a subscriber: kadircet. Herald added a project: clang-tools-extra. Fixed clangd test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158472/new/ https://reviews.llvm.org/D158472 Files:

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

2023-08-21 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. This breaks the one-note-for-one-overload-candidate rule of overload resolution failure diagnostics (https://github.com/llvm/llvm-project/blob/ff08c8e57e39d7970b65637595cdc221901f4ed1/clang/lib/Sema/SemaOverload.cpp#L11517-L11526), but in most cases this change would

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

2023-08-21 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, cjdb, tbaeder, shafik. Herald added a subscriber: arphaman. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. D153359 addressed the

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

2023-08-21 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 552167. hazohelet marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155610/new/ https://reviews.llvm.org/D155610 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaDeclCXX.cpp

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

2023-08-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked an inline comment as done. hazohelet added inline comments. Comment at: libcxx/include/__type_traits/is_constant_evaluated.h:31 + return false; +#endif } philnik wrote: > Mordante wrote: > > hazohelet wrote: > > > Mordante wrote: > > > > Why

[PATCH] D157383: [clang][Diagnostics] Provide source range to integer-overflow warnings

2023-08-19 Thread Takuya Shimizu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG985a72b6b3e7: [clang][Diagnostics] Provide source range to integer-overflow warnings (authored by hazohelet). Changed prior to commit: https://reviews.llvm.org/D157383?vs=548149=551746#toc Repository:

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

2023-08-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 551744. hazohelet marked 2 inline comments as done. hazohelet added a comment. Address comments from Mark - Added comment about the need of macro use in libc++ include file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/

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

2023-08-19 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: libcxx/include/__type_traits/is_constant_evaluated.h:31 + return false; +#endif } Mordante wrote: > Why is this needed? Does this mean the builtin will fail in C++03 mode? `__libcpp_is_constant_evaluated` always

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

2023-08-17 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/D157526/new/ https://reviews.llvm.org/D157526 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-08-17 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. hazohelet marked an inline comment as done. Closed by commit rGb3469ce6f80b: [clang][Analysis] Handle and || against variable and its negation as… (authored by

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

2023-08-16 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550899. hazohelet added a comment. rebase to upstream to run ci CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/ https://reviews.llvm.org/D155064 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticASTKinds.td

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

2023-08-16 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550881. hazohelet marked an inline comment as done. hazohelet added a comment. Address comments from Chris - Generate fix-it hint to remove `constexpr` in constexpr-if Added `SourceLocation` field to Sema that saves the location of `constexpr` in

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

2023-08-16 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550707. hazohelet marked 3 inline comments as done. hazohelet added a comment. Address comments from Hubert - Bring back type prefix - NFC stylistic changes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155610/new/

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Thanks for the feedback. Comment at: clang/test/SemaCXX/warn-constant-evaluated-constexpr.cpp:38 constexpr int fn5() { - if constexpr (__builtin_is_constant_evaluated()) // expected-warning {{'__builtin_is_constant_evaluated' will always evaluate

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550443. hazohelet added a comment. Removed warning fixes that are now in D158016 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152495/new/ https://reviews.llvm.org/D152495 Files: clang/docs/ReleaseNotes.rst

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: nikic, aaron.ballman, MaskRay, tbaeder. Herald added subscribers: hoy, wlei, steakhal, abrachet, ormris, StephenFan, martong, hiraditya. Herald added a reviewer: NoQ. Herald added projects: lld-macho, All. Herald added a reviewer:

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550433. hazohelet added a comment. Herald added subscribers: llvm-commits, wangpc, hoy, wlei, steakhal, abrachet, ormris, martong, MaskRay, hiraditya. Herald added a reviewer: NoQ. Herald added projects: LLVM, lld-macho. Herald added a reviewer: lld-macho.

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550403. hazohelet marked 16 inline comments as done. hazohelet added a comment. Address some review comments - Renamed `ConvertCharToString` to `WriteCharValueForDiagnostic` - Made the function static - Fixed the printing for unicode 0x80 ~ 0xFF - Added

[PATCH] D157383: [clang][Diagnostics] Provide source range to integer-overflow warnings

2023-08-15 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/D157383/new/ https://reviews.llvm.org/D157383 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D152495#4587804 , @chapuni wrote: > Would this cause many warnings in Clang/LLVM tree? > https://lab.llvm.org/buildbot/#/builders/36/builds/36560 > > I hope you to fix possible warnings at first. Thanks. I'll revert this

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

2023-08-15 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 550216. hazohelet marked an inline comment as done. hazohelet added a comment. Address comments from Timm - Moved test to C++14,20,23 test file from C++20-only one - NFC stylistic changes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157855/new/

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

2023-08-14 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, cjdb. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. BEFORE this patch, compound assignment operator against uninitialized object such as `uninit += 1`

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

2023-08-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 549203. hazohelet added a comment. Resolved the constexpr-if init-statement expression evaluation context problem. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/ https://reviews.llvm.org/D155064 Files: clang/docs/ReleaseNotes.rst

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

2023-08-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 548948. hazohelet marked 2 inline comments as done. hazohelet added a comment. Address comments from Aaron - Use hex code for integer representation of textual types - NFC stylistic changes CHANGES SINCE LAST ACTION

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-10 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D156604#4572994 , @tbaeder wrote: > While both of those suggestions are probably improvements (I haven't > checked), they also seem out of scope for this patch. This is just adding > source ranges. We can improve them

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

2023-08-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, erichkeane, tbaeder, shafik. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. BEFORE this patch, when clang handles constraints like `C1 || C2` where `C1` evaluates

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet accepted this revision. hazohelet added a comment. I think it would be helpful to point to the subobject source range when diagnosing errors in subobject dtors, so I left some suggestions. Otherwise this LGTM. Thanks! Comment at: clang/lib/AST/ExprConstant.cpp:6663

[PATCH] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-09 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. We need some tests for dtors because they are handled differently from other functions. I think the current ExprConstant part would not cover the explicitly-called dtors because the `HandleDestructorImpl` only has access to `CallLoc` and not source range. Also new

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

2023-08-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 548197. hazohelet added a comment. - Tentatively disable the warning on macros so as not to make a fuss in libc++ tests. - Fixed incorrect output in arguments. - Fixed incorrect output in declaration of init-statement of constexpr-if condition. - Added

[PATCH] D157383: [clang][Diagnostics] Provide source range to integer-overflow warnings

2023-08-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:530-535 if (S.checkingForUndefinedBehavior()) { SmallString<32> Trunc; APResult.trunc(Result.bitWidth()).toString(Trunc, 10); auto Loc = E->getExprLoc(); -S.report(Loc,

[PATCH] D157383: [clang][Diagnostics] Provide source range to integer-overflow warnings

2023-08-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:530-535 if (S.checkingForUndefinedBehavior()) { SmallString<32> Trunc; APResult.trunc(Result.bitWidth()).toString(Trunc, 10); auto Loc = E->getExprLoc(); -S.report(Loc,

[PATCH] D157383: [clang][Diagnostics] Provide source range to integer-overflow warnings

2023-08-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet created this revision. hazohelet added reviewers: aaron.ballman, tbaeder, cjdb. Herald added a project: All. hazohelet requested review of this revision. Herald added a project: clang. BEFORE: overflow.cpp:1:21: warning: overflow in expression; result is -2147483648 with type 'int'

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

2023-08-08 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D152495#4566634 , @aaron.ballman wrote: > In D152495#4563520 , @hazohelet > wrote: > >> I reverted this change because it broke sanitizer buildbots. >>

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

2023-08-08 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 rG24c91d443222: [clang][ExprConstant] Fix crash on uninitialized base class subobject (authored by hazohelet). Changed prior to commit:

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

2023-08-07 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. I've noticed several shortcoming/limitations of this patch. 1. Function arguments: When we parse the arguments to a function call, the callee isn't still resolved, so we don't know whether it's consteval. If the callee is consteval, its argument is known to be

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

2023-08-06 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. I reverted this change because it broke sanitizer buildbots. https://lab.llvm.org/buildbot/#/builders/19/builds/18369 The cause of the errors here are relatively clear and I can speculatively replace `if (std::error_code EC = makeCanonical(Path))` with `if

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

2023-08-06 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 rGbd0ed0abc31f: [Clang][SemaCXX] Add unused warning for variables declared in condition… (authored by hazohelet). Changed prior to commit:

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

2023-08-04 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/docs/ReleaseNotes.rst:103-137 +- When describing the failure of static assertion of `==` expression, clang prints the integer + representation of the value as well as its character representation when + the user-provided

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

2023-08-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. One concern from my side is that some unicode characters like `U+FEFF` (I added in test) are invisible, but it may not be a big concern because we also display integer representation in parens. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155610/new/

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

2023-08-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 546832. hazohelet marked 2 inline comments as done. hazohelet retitled this revision from "[Clang][ExprConstant] Print integer instead of character on static assertion failure" to "[Clang][Sema] Fix display of characters on static assertion failure".

[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure

2023-08-03 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 546782. hazohelet added a comment. Address comments from Corentin - Use default `pushEscapedString` escaping (``) instead of UCN representation `\u0001` - Convert multi-byte characters (`wchar_t`, `char16_t`, `char32_t`) to UTF-8 and prints them. - Added

[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure

2023-08-02 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D155610#4550346 , @cor3ntin wrote: > I've been thinking about it and I think I have a cleaner design for the > printing of characters: > > We need a `CharToString(unsigned, Qualtype) -> SmallString` method that takes > a

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

2023-08-01 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: > aaron.ballman

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

2023-08-01 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] D156604: [clang][ExprConst] Use call source range for 'in call to' diags

2023-08-01 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D156604#4549524 , @tbaeder wrote: > @hazohelet I changed this to just return `CallExpr->getSourceRange()` and to > not save a source range separately. Can you give this a look please? I was thinking about removing

[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure

2023-07-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/lib/Basic/Diagnostic.cpp:838-858 + if (UseUCN) +OutStream << "\\u" + << llvm::format_hex_no_prefix(CodepointValue, /*Width=*/4, +/*Upper=*/false); +

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

2023-07-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. @ldionne @philnik @Mordante Is this way of fixing libc++ tests OK from libc++ side? If there's better way to fix them I am happy to follow it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155064/new/ https://reviews.llvm.org/D155064

[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure

2023-07-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 545582. hazohelet added a comment. Address review comments - Print the character representation only when the type of the expressions is `char` or `char8_t` - Use `pushEscapedString` in the printing so that we can reuse its escaping logic - Use

[PATCH] D155610: [Clang][ExprConstant] Print integer instead of character on static assertion failure

2023-07-31 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. Thanks everyone for the comments! Comment at: clang/test/Lexer/cxx1z-trigraphs.cpp:24 // expected-error@11 {{}} expected-warning@11 {{trigraph ignored}} -// expected-error@13 {{failed}} expected-warning@13 {{trigraph ignored}} expected-note@13

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

2023-07-31 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 rGe90f4fc6acaf: [clang][ExprConstant] Print template arguments when describing stack frame (authored by hazohelet). Repository: rG LLVM Github

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

2023-07-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 545216. hazohelet added a comment. Added missing tests for method function templates before landing this CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154366/new/ https://reviews.llvm.org/D154366 Files: clang/docs/ReleaseNotes.rst

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

2023-07-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet marked 2 inline comments as done. hazohelet added a comment. Thanks for the review Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9743-9748 +def warn_tautological_negation_and_compare: Warning< + "'&&' against a variable and its negation always

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

2023-07-28 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 545213. hazohelet added a comment. Address comments from Aaron - Reworded diagnostic message CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152093/new/ https://reviews.llvm.org/D152093 Files: clang/docs/ReleaseNotes.rst

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

2023-07-27 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] D154366: [clang][ExprConstant] Print template arguments when describing stack frame

2023-07-25 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added a comment. In D154366#4530536 , @dblaikie wrote: > @hazohelet can you commit this yourself, or do you need someone to commit it > on your behalf? (& if so, what name/email address would you like to be > credited) Thanks for the review.

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

2023-07-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet added inline comments. Comment at: clang/test/SemaCXX/vartemplate-lambda.cpp:17 +// expected-note{{cannot be used in a constant expression}} \ +//

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

2023-07-24 Thread Takuya Shimizu via Phabricator via cfe-commits
hazohelet updated this revision to Diff 543510. hazohelet marked 4 inline comments as done. hazohelet added a comment. Address comments from Corentin - When emitting "lambda expression may not appear inside of a constant expression" error from `Sema::PopExpressionEvaluationContext`, mark the

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

2023-07-24 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

  1   2   3   >