LegalizeAdulthood marked an inline comment as done.

================
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);
----------------
aaron.ballman wrote:
> Will this match g() in C mode?
No, because it doesn't declare g as a prototype.  To declare it as a prototype, 
it needs to be written

`void g(void);`


================
Comment at: unittests/ASTMatchers/ASTMatchersTest.cpp:4988
@@ +4987,3 @@
+  EXPECT_TRUE(matches("typedef int hasUnderlyingTypeTest;",
+                      typedefDecl(hasUnderlyingType(asString("int")))));
+}
----------------
aaron.ballman wrote:
> 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?)
This passes:

  EXPECT_TRUE(
      matches("typedef int foo; typedef foo bar;",
              typedefDecl(hasUnderlyingType(asString("foo")), hasName("bar"))));

but this does not:

  EXPECT_TRUE(
      matches("typedef int foo; typedef foo bar;",
              typedefDecl(hasUnderlyingType(asString("int")), hasName("bar"))));

I'm not really sure why; I expected that `Node.getUnderlyingType()` would 
return `int`, not `foo`.


http://reviews.llvm.org/D8149



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to