[clang] [SSAF][PointerFlowExtractor] Handle empty initializer lists for scalars and unions (PR #201968)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 01:55:37 PDT 2026


================
@@ -967,6 +967,53 @@ TEST_F(PointerFlowTest, ArrayOfStructInitList) {
                                       }));
 }
 
+TEST_F(PointerFlowTest, ScalarPointerBraceInit) {
+  ASSERT_EQ(setUpTest(R"cpp(
+    int *q;
+    void foo() {
+      int *p{q};
+    }
+  )cpp"),
+            true);
----------------
steakhal wrote:

Please don't use `ASSERT_TRUE` for expressing this.
That is less cognitively taxing, so I wouldn't need to buffer everything until I get to see that the result is compared against `true`.

I'm open to be challenged here, but right now I don't see a downside of using `ASSERT_TRUE` here and in the future.

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


More information about the cfe-commits mailing list