aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.
================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4022
@@ +4021,3 @@
+/// functionProtoType()
+/// matches "int (*f)(int)" and the type of "g".
+AST_TYPE_MATCHER(FunctionProtoType, functionProtoType);
----------------
Will this match g() in C mode?
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4282
@@ +4281,3 @@
+ EXPECT_TRUE(matches("void f(int i);", functionProtoType()));
+ EXPECT_TRUE(matches("void f();", functionProtoType(parameterCountIs(0))));
+}
----------------
I would like to see tests using matchesC() for void f() (for both
functionProtoType() and parameterCountIs()).
================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4988
@@ +4987,3 @@
+ EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;",
+ typedefDecl(hasUnderlyingType(asString("int")))));
+}
----------------
Can we have a test for:
```
EXPECT_TRUE(matches("typedef int foo; typedef foo bar;",
typedefDecl(hasUnderlyingType(asString("int")), hasName("bar"))));
```
(I assume that this should work?)
http://reviews.llvm.org/D8149
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits