[clang] [clang][dataflow] Fully support Environment construction for Stmt analysis. (PR #91616)

via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 01:07:35 PDT 2024


================
@@ -146,6 +146,30 @@ TEST_F(DataflowAnalysisTest, DiagnoseFunctionDiagnoserCalledOnEachElement) {
                                    " (Lifetime ends)\n")));
 }
 
+TEST_F(DataflowAnalysisTest, CanAnalyzeStmt) {
+  std::string Code = R"cc(
+      struct S {int i;};
+      S getAnS() {return S{1};};
+      void foo() {
+        S AnS = getAnS();
+      }
----------------
martinboehme wrote:

```suggestion
      struct S { int i; };
      S getAnS() {return S{1};};
      S AnS = getAnS();
```

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


More information about the cfe-commits mailing list