[cfe-commits] [PATCH] Implement descendant matchers for NestedNamespecifiers
Daniel Jasper
djasper at google.com
Tue Oct 30 05:49:24 PDT 2012
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3250
@@ +3249,3 @@
+ nestedNameSpecifier(specifiesType(asString("struct a::A::B")),
+ hasDescendant(nestedNameSpecifier(
+ specifiesNamespace(hasName("a")))))));
----------------
Manuel Klimek wrote:
> I just hope our users will find that intuitive :P
I doubt this has many useful applications other than to test NestedNameSpecifiers. However, any suggestions welcome :-).
================
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(
----------------
Manuel Klimek wrote:
> dd
Done.
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3274
@@ +3273,3 @@
+
+ // Not really useful, but to complete the interface.
+ EXPECT_TRUE(matchAndVerifyResultTrue(
----------------
Manuel Klimek wrote:
> If you want that comment here, please add *why* it's not useful...
Done.
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:3282
@@ +3281,3 @@
+
+TEST(NNSLoc, Descendants) {
+ std::string Fragment =
----------------
Manuel Klimek wrote:
> 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.
Done.
http://llvm-reviews.chandlerc.com/D86
More information about the cfe-commits
mailing list