File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -6678,6 +6678,13 @@ static BaseType _determineNonSuffixedIntegerLiteralType(
6678
6678
6679
6679
if (isDecimalBase)
6680
6680
{
6681
+ // There is an edge case here where 9223372036854775808 or INT64_MAX + 1
6682
+ // brings us here, but the complete literal is -9223372036854775808 or INT64_MIN and is valid.
6683
+ // Unfortunately because the lexer handles the negative(-) part of the literal separately
6684
+ // it is impossible to know whether the literal has a negative sign or not.
6685
+ // We emit the warning and initially process it as a uint64 anyways, and the negative sign
6686
+ // will be properly parsed and the value will still be properly stored as a negative INT64_MIN.
6687
+
6681
6688
// Decimal integer is too large to be represented as signed.
6682
6689
// Output warning that it is represented as unsigned instead.
6683
6690
sink->diagnose (
You can’t perform that action at this time.
0 commit comments