Qualify all types used in AST matcher macros. This makes it possible to
put AST matchers in user code into a namespace other than clang::ast_matchers
and this way prevent ODR violations that could happen when a matcher with the
same name is defined in multiple translation units. Updated comments
accordingly.
Details
Details
Diff Detail
Diff Detail
Event Timeline
include/clang/ASTMatchers/ASTMatchersMacros.h | ||
---|---|---|
23–26 | 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? |
include/clang/ASTMatchers/ASTMatchersMacros.h | ||
---|---|---|
23–26 | No, they can be in any namespace now. I just wanted to emphasize that putting all user-defined matchers to clang::ast_matchers is not a good idea. I'll suggest to use user's own namespace for the matchers. |
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?