================ @@ -403,4 +405,35 @@ TEST_F(EnvironmentTest, Contains(Member)); } +TEST_F(EnvironmentTest, Stmt) { + using namespace ast_matchers; + + std::string Code = R"cc( + struct S {int i;}; + void foo() { + S AnS = S{1}; + } ---------------- bazuzi wrote:
A variable declaration outside a function doesn't actually exist within a Stmt, nor is it a Stmt. In order to analyze a global variable declaration, one option is to synthesize a DeclStmt that holds the VarDecl. I was trying to keep this test simple, but could add an additional test for this synthesis pattern? 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