[clang] [BitInt] Expose a _BitInt literal suffix in C++ (PR #86586)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 06:39:28 PDT 2024


================
@@ -1117,6 +1118,26 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling,
       if (isImaginary) break;   // Cannot be repeated.
       isImaginary = true;
       continue;  // Success.
+    case '_':
+      if (isFPConstant)
+        break; // Invalid for floats
+      if (HasSize)
+        break;
+      if (PossibleBitInt)
+        break; // Cannot be repeated.
+      if (LangOpts.CPlusPlus && s[1] == '_') {
----------------
Sirraide wrote:

I recall reading somewhere that one character of overscan is allowed in `NumericLiteralParser`, but I’m not sure if that applies here.

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


More information about the cfe-commits mailing list