llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Mike Rice (mikerice1969)

<details>
<summary>Changes</summary>

Address static verifier concerns about dead code in DoubleUnderscore check. 
Replace it with an assert.

---
Full diff: https://github.com/llvm/llvm-project/pull/96579.diff


1 Files Affected:

- (modified) clang/lib/Lex/LiteralSupport.cpp (+3-2) 


``````````diff
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index 3df0391bdda77..9d2720af5dbd9 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -1123,8 +1123,9 @@ NumericLiteralParser::NumericLiteralParser(StringRef 
TokSpelling,
         break; // Invalid for floats
       if (HasSize)
         break;
-      if (DoubleUnderscore)
-        break; // Cannot be repeated.
+      // There is currently no way to reach this with DoubleUnderscore set.
+      // If new double underscope literals are added handle it here as above.
+      assert(!DoubleUnderscore && "unhandled double underscore case");
       if (LangOpts.CPlusPlus && s + 2 < ThisTokEnd &&
           s[1] == '_') { // s + 2 < ThisTokEnd to ensure some character exists
                          // after __

``````````

</details>


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

Reply via email to