Closed as not planned
Description
The following C source code:
int x = 0 ? 9223372036854775807L : 2147483648;
Produces the following warning when compiled with Clang:
$ clang --version
clang version 16.0.6 (Fedora 16.0.6-2.fc38)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ clang -Wconstant-conversion -fsyntax-only test.c
test.c:1:13: warning: implicit conversion from 'long' to 'int' changes value from 9223372036854775807 to -1 [-Wconstant-conversion]
int x = 0 ? 9223372036854775807L : 2147483647;
~ ^~~~~~~~~~~~~~~~~~~~
1 warning generated.
0 ? 9223372036854775807L : 2147483647
evaluates to 2147483647L
, so this warning is incorrect. GCC's similar -Woverflow
doesn't trigger for this test case.