================
@@ -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;
----------------
zygoloid wrote:

FYI, per CWG1810 / [over.literal]/1, it's now IFNDR rather than UB:

> Some literal suffix identifiers are reserved for future standardization; see 
> [usrlit.suffix]. A declaration whose literal-operator-id uses such a literal 
> suffix identifier is ill-formed, no diagnostic required.

... but that doesn't make a difference here. (The "NDR" part is just to allow 
implementations to permit the standard library to declare these literal 
operators.)

https://github.com/llvm/llvm-project/pull/86586
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to