[clang] [clang] Emit bad shift warnings (PR #70307)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 18 06:50:50 PDT 2024
================
@@ -277,7 +277,9 @@ void dr258(void) {
void dr261(void) {
/* This is still an integer constant expression despite the overflow. */
enum e1 {
- ex1 = __INT_MAX__ + 1 /* expected-warning {{overflow in expression; result is -2'147'483'648 with type 'int'}} */
+ ex1 = __INT_MAX__ + 1 /* expected-warning {{overflow in expression; result is -2'147'483'648 with type 'int'}}
+ c89only-error {{expression is not an integer constant expression}}
----------------
AaronBallman wrote:
Same question here as to why this is an error in C89.
https://github.com/llvm/llvm-project/pull/70307
More information about the cfe-commits
mailing list