[cfe-commits] [PATCH] Implement descendant matchers for NestedNamespecifiers
Manuel Klimek
klimek at google.com
Tue Oct 30 03:02:12 PDT 2012
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3250
@@ +3249,3 @@
+ nestedNameSpecifier(specifiesType(asString("struct a::A::B")),
+ hasDescendant(nestedNameSpecifier(
+ specifiesNamespace(hasName("a")))))));
----------------
I just hope our users will find that intuitive :P
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3257-3261
@@ +3256,7 @@
+ specifiesNamespace(hasName("a")))))));
+ EXPECT_TRUE(matches(
+ Fragment,
+ nestedNameSpecifier(specifiesType(asString("struct a::A")),
+ has(nestedNameSpecifier(
+ specifiesNamespace(hasName("a")))))));
+ EXPECT_TRUE(matches(
----------------
dd
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3274
@@ +3273,3 @@
+
+ // Not really useful, but to complete the interface.
+ EXPECT_TRUE(matchAndVerifyResultTrue(
----------------
If you want that comment here, please add *why* it's not useful...
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3282
@@ +3281,3 @@
+
+TEST(NNSLoc, Descendants) {
+ std::string Fragment =
----------------
I'd pull apart the tests so that there's one for using nested name specifiers as descendants, and one for using them as top-level nodes.
http://llvm-reviews.chandlerc.com/D86
More information about the cfe-commits
mailing list