Skip to content

Commit 54b61ad

Browse files
authored
[NFC][clang] Replace unreachable code in literal processing with assert (#96579)
Address static verifier concerns about dead code in DoubleUnderscore check. Replace it with an assert.
1 parent 2dd4167 commit 54b61ad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Lex/LiteralSupport.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling,
11231123
break; // Invalid for floats
11241124
if (HasSize)
11251125
break;
1126-
if (DoubleUnderscore)
1127-
break; // Cannot be repeated.
1126+
// There is currently no way to reach this with DoubleUnderscore set.
1127+
// If new double underscope literals are added handle it here as above.
1128+
assert(!DoubleUnderscore && "unhandled double underscore case");
11281129
if (LangOpts.CPlusPlus && s + 2 < ThisTokEnd &&
11291130
s[1] == '_') { // s + 2 < ThisTokEnd to ensure some character exists
11301131
// after __

0 commit comments

Comments
 (0)