[PATCH] D95740: [ASTMatchers] Ignore parts of BindingDecls which are not spelled in source

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 1 10:30:00 PST 2021


aaron.ballman added inline comments.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:2607
+    EXPECT_TRUE(matches(Code, traverse(TK_AsIs, M)));
+    EXPECT_FALSE(matches(Code, traverse(TK_IgnoreUnlessSpelledInSource, M)));
+  }
----------------
Can you help me to better understand the proposed change? I find this to be surprising behavior -- the thing the user wrote in the source are the binding declarations, the hidden thing they didn't write in the source was the decomposition declaration. e.g., the user introduced some names `f`, `s`, and `t` in the declaration so I would imagine that these *are* spelled in source. What I don't think is necessarily spelled in source is the decomposition declaration for the `int[3]` to bind to. So I was expecting this to be `EXPECT_TRUE` instead of `EXPECT_FALSE`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95740/new/

https://reviews.llvm.org/D95740



More information about the cfe-commits mailing list