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

Not necessary -- because it's undefined behavior, we're not breaking anything, 
the code was already broken to begin with. Also, users already get a reasonable 
diagnostic on the declaration of the UDL:
```
warning: user-defined literal suffixes containing '__' are reserved; no literal 
will invoke this operator [-Wuser-defined-literals]
    1 | unsigned operator ""__w(const char *);
```

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