aaron.ballman added inline comments.
================ Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:313 + AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc), + std::string, MacroName) { // Verifies that the statement' beginning and ending are both expanded from ---------------- You mentioned that the change from `StringRef` to `std::string` was to avoid lifetime issues while matching, but I'm wondering if you can expound on that situation a bit more. I would have assumed that any memoization that involves `StringRef` would be responsible for the lifetime issues rather than the matchers themselves, but maybe I'm thinking about a different way you can hit lifetime issues than you are. ================ Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:150 + )cc"; + EXPECT_TRUE(matches(input, varDecl(isExpandedFromMacro("MY_MACRO")))); +} ---------------- Can you also add a test for type-based matching? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90303/new/ https://reviews.llvm.org/D90303 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits