[clang] [C2y] Handle FP-suffixes on prefixed octals (#141230) (PR #141695)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 4 09:26:57 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions c,cpp -- clang/lib/Lex/LiteralSupport.cpp clang/test/C/C2y/n3353.c
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index ad387e1c5..a62508e3e 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -1438,8 +1438,10 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
       // Done
     } else if ((isHexDigit(*s) && *s != 'e' && *s != 'E' && *s != '.') &&
                !isValidUDSuffix(LangOpts, StringRef(s, ThisTokEnd - s))) {
-      auto InvalidDigitLoc = Lexer::AdvanceToTokenCharacter(TokLoc, s - ThisTokBegin, SM, LangOpts);
-      Diags.Report(InvalidDigitLoc, diag::err_invalid_digit) << StringRef(s, 1) << 1;
+      auto InvalidDigitLoc = Lexer::AdvanceToTokenCharacter(
+          TokLoc, s - ThisTokBegin, SM, LangOpts);
+      Diags.Report(InvalidDigitLoc, diag::err_invalid_digit)
+          << StringRef(s, 1) << 1;
       hadError = true;
     }
     // Other suffixes will be diagnosed by the caller.

``````````

</details>


https://github.com/llvm/llvm-project/pull/141695


More information about the cfe-commits mailing list