[clang] [C2y] Correctly handle 0 in the preprocessor (PR #137844)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 29 09:53:11 PDT 2025


================
@@ -1453,6 +1454,8 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
   // anything, we leave the digit start where it was.
   if (s != PossibleNewDigitStart)
     DigitsBegin = PossibleNewDigitStart;
+  else
+    IsNakedZero = s == ThisTokEnd; // Is the only thing we've seen a 0?
----------------
erichkeane wrote:

```suggestion
    IsNakedZero = (s == ThisTokEnd); // Is the only thing we've seen a 0?
```

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


More information about the cfe-commits mailing list