Skip to content

[NFC][clang] Replace unreachable code in literal processing with assert #96579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clang/lib/Lex/LiteralSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling,
break; // Invalid for floats
if (HasSize)
break;
if (DoubleUnderscore)
break; // Cannot be repeated.
// There is currently no way to reach this with DoubleUnderscore set.
// If new double underscope literals are added handle it here as above.
assert(!DoubleUnderscore && "unhandled double underscore case");
if (LangOpts.CPlusPlus && s + 2 < ThisTokEnd &&
s[1] == '_') { // s + 2 < ThisTokEnd to ensure some character exists
// after __
Expand Down
Loading