I need to catch cases in C++ code when there are two or more similar access specifiers in the class. Let's say there are two classes
class A{
public:
int b;
public:
int a;
}
class B{
public:
int a;
}
How to match class A (because it has two 'public's) but not class B with ASTMatcher?
This matcher grabs the 'public' declaration:
In the callback class, you can track the number of hits the matcher gets for a given struct declaration, for example with a
std::map<string,int>
: