[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-14 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta closed this revision. xgupta added a comment. In D127518#3581620 , @aaron.ballman wrote: > LGTM! Please add a release note about the issue that was fixed when landing. Done, Thank you for reviewing. Committed in https://reviews.llvm.org/rG48e18

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. LGTM! Please add a release note about the issue that was fixed when landing. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127518/new/ https://reviews.llvm.org/D127518 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-14 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 436746. xgupta added a comment. . CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127518/new/ https://reviews.llvm.org/D127518 Files: clang/lib/Sema/SemaExpr.cpp clang/test/CXX/expr/expr.const/p2-0x.cpp clang/test/SemaCXX/constant-expression-cxx

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11423-11425 + // Don't warn in C++2A mode (and newer), as signed left shifts + // always wrap and never overflow. + if (S.getLangOpts().CPlusPlus20) I think this should also be checki

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-13 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta updated this revision to Diff 436557. xgupta added a comment. Address comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127518/new/ https://reviews.llvm.org/D127518 Files: clang/lib/Sema/SemaExpr.cpp clang/test/CXX/expr/expr.const/p2-0x.cpp clang/test/SemaCXX/constant

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11425-11426 // then, the behavior is undefined before C++2a. Warn about it. if (Left.isNegative() && !S.getLangOpts().isSignedOverflowDefined() && !S.getLangOpts().CPlusPlus20) { S.DiagRun

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: clang-language-wg. aaron.ballman added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11422 llvm::APSInt Left = LHSResult.Val.getInt(); // If LHS does not have a signed type and non-negative value ... to early her

[PATCH] D127518: [Diagnostics] Fix inconsistent shift-overflow warnings in C++20

2022-06-10 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta created this revision. xgupta added a reviewer: aaron.ballman. Herald added a project: All. xgupta requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This fixes https://github.com/llvm/llvm-project/issues/52873. Don't warn in C++2A mode