[PATCH] New ASTMatcher and enhancement to hasOverloadedOperatorName

Edwin Vane edwin.vane at intel.com
Wed Mar 6 08:02:17 PST 2013



================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:386
@@ +385,3 @@
+  }
+  LLVM_OVERRIDE;
+
----------------
Manuel Klimek wrote:
> Can't that go before the opening curly? (I have no idea about the new cool override keywords, so I'm curious :)
Ooops. It's actually supposed to go before the function body. That's a c++11 build failure waiting to happen.

================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:378
@@ +377,3 @@
+template <typename T, typename ArgT>
+class HasOverloadedOperatorNameMatcher : public SingleNodeMatcherInterface<T> {
+public:
----------------
Manuel Klimek wrote:
> Please put in a TOOLING_COMPILE_ASSERT that T is one of the supported types?
A static assert for T isn't necessary I think since if it isn't one of the supported types you just get an error saying there's no overload for matchesSpecialized() for the given T. This is the same as the HasDeclarationMatcher right below.

As for ArgT, it can really only be StringRef but the error will point somewhere in PolymorphicMatcherWithParam1 probably as it tries to construct HasOverloadedOperatorName. I'll check the error message and if it's not obvious I'll add a static assert.


http://llvm-reviews.chandlerc.com/D494

BRANCH
  matchers

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list