================
@@ -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();
+      }
----------------
bazuzi wrote:

Same reason not to use a global variable as above. Additionally, 
`AdornedCFG::build` expects to take a `FunctionDecl` in which the provided 
`Stmt` resides. In the case of `DeclStmt`s, this `FunctionDecl` doesn't seem to 
actually be used at all, but support may not be guaranteed.

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

Reply via email to