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

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 09:29:49 PDT 2024


================
@@ -1117,19 +1118,37 @@ 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] == '_') {
+        // Scan ahead to find possible rest of BitInt suffix
+        for (const char *c = s; c != ThisTokEnd; ++c) {
+          if (*c == 'w' || *c == 'W') {
+            possibleBitInt = true;
+            ++s;
----------------
js324 wrote:

Should I add your remark to the Release Notes as a potentially breaking change or is it not necessary? 

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


More information about the cfe-commits mailing list