[PATCH] Qualify all types used in AST matcher macros.

Daniel Jasper djasper at google.com
Wed Jun 17 05:30:12 PDT 2015


================
Comment at: include/clang/ASTMatchers/ASTMatchersMacros.h:23-26
@@ -22,4 +22,6 @@
 //
-//  To define a matcher in user code, always put it into the clang::ast_matchers
-//  namespace and refer to the internal types via the 'internal::':
+//  To define a matcher in user code, always put it into an unnamed namespace
+//  inside the clang::ast_matchers namespace and refer to the internal types via
+//  the 'internal::'. This would help to prevent ODR violations in case a
+//  matcher with the same name is defined in multiple translation units:
 //
----------------
I don't know whether we need to recommend using an unnamed namespace. I would think that certain projects also have a repository of their own reusable matchers.

Do the custom matchers even have to be inside ::clang::ast_matchers?

http://reviews.llvm.org/D10501

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list