Gustas =?utf-8?q?Janušonis?= <[email protected]>,
Gustas =?utf-8?q?Janušonis?= <[email protected]>,LeGusto
 <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>


================
@@ -340,6 +340,17 @@ TEST_F(NumericLiteralCaseTest, 
UnderScoreSeparatorLanguages) {
   verifyFormat("o = 0o0_10_010;", "o = 0O0_10_010;", Style);
 }
 
+TEST_F(NumericLiteralCaseTest, IncompleteLiteralDoesNotCrash) {
----------------
owenca wrote:

You should move the tests to `NumericLiteralInfoTest`, e.g.:
```diff
diff --git a/clang/unittests/Format/NumericLiteralInfoTest.cpp 
b/clang/unittests/Format/NumericLiteralInfoTest.cpp
index a892cfff531e..329c79c71e58 100644
--- a/clang/unittests/Format/NumericLiteralInfoTest.cpp
+++ b/clang/unittests/Format/NumericLiteralInfoTest.cpp
@@ -66,6 +66,14 @@ TEST_F(NumericLiteralInfoTest, FloatingPointLiteral) {
   EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0xF.Fp-9_Pa"), 1, 3, 5, 8));
 }
 
+TEST_F(NumericLiteralInfoTest, InvalidNumericLiteral) {
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("1e")));
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("1.0e")));
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0x")));
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0x_")));
+  EXPECT_TRUE(verifyInfo(NumericLiteralInfo("0x1p")));
+}
+
 } // namespace
 } // namespace format
 } // namespace clang
```

https://github.com/llvm/llvm-project/pull/206594
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to