@@ -757,7 +757,8 @@ class ASTMatchFinder {
757
757
std::is_base_of<NestedNameSpecifier, T>::value ||
758
758
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
759
759
std::is_base_of<TypeLoc, T>::value ||
760
- std::is_base_of<QualType, T>::value,
760
+ std::is_base_of<QualType, T>::value ||
761
+ std::is_base_of<Attr, T>::value,
761
762
" unsupported type for recursive matching" );
762
763
return matchesChildOf (DynTypedNode::create (Node), getASTContext (), Matcher,
763
764
Builder, Bind);
@@ -771,7 +772,8 @@ class ASTMatchFinder {
771
772
std::is_base_of<NestedNameSpecifier, T>::value ||
772
773
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
773
774
std::is_base_of<TypeLoc, T>::value ||
774
- std::is_base_of<QualType, T>::value,
775
+ std::is_base_of<QualType, T>::value ||
776
+ std::is_base_of<Attr, T>::value,
775
777
" unsupported type for recursive matching" );
776
778
return matchesDescendantOf (DynTypedNode::create (Node), getASTContext (),
777
779
Matcher, Builder, Bind);
@@ -785,7 +787,8 @@ class ASTMatchFinder {
785
787
static_assert (std::is_base_of<Decl, T>::value ||
786
788
std::is_base_of<NestedNameSpecifierLoc, T>::value ||
787
789
std::is_base_of<Stmt, T>::value ||
788
- std::is_base_of<TypeLoc, T>::value,
790
+ std::is_base_of<TypeLoc, T>::value ||
791
+ std::is_base_of<Attr, T>::value,
789
792
" type not allowed for recursive matching" );
790
793
return matchesAncestorOf (DynTypedNode::create (Node), getASTContext (),
791
794
Matcher, Builder, MatchMode);
@@ -954,7 +957,7 @@ class HasNameMatcher : public SingleNodeMatcherInterface<NamedDecl> {
954
957
955
958
bool matchesNode (const NamedDecl &Node) const override ;
956
959
957
- private:
960
+ private:
958
961
// / Unqualified match routine.
959
962
// /
960
963
// / It is much faster than the full match, but it only works for unqualified
@@ -1175,7 +1178,8 @@ struct IsBaseType {
1175
1178
std::is_same<T, NestedNameSpecifier>::value ||
1176
1179
std::is_same<T, NestedNameSpecifierLoc>::value ||
1177
1180
std::is_same<T, CXXCtorInitializer>::value ||
1178
- std::is_same<T, TemplateArgumentLoc>::value;
1181
+ std::is_same<T, TemplateArgumentLoc>::value ||
1182
+ std::is_same<T, Attr>::value;
1179
1183
};
1180
1184
template <typename T>
1181
1185
const bool IsBaseType<T>::value;
@@ -1185,7 +1189,7 @@ const bool IsBaseType<T>::value;
1185
1189
// / Useful for matchers like \c anything and \c unless.
1186
1190
using AllNodeBaseTypes =
1187
1191
TypeList<Decl, Stmt, NestedNameSpecifier, NestedNameSpecifierLoc, QualType,
1188
- Type, TypeLoc, CXXCtorInitializer>;
1192
+ Type, TypeLoc, CXXCtorInitializer, Attr >;
1189
1193
1190
1194
// / Helper meta-function to extract the argument out of a function of
1191
1195
// / type void(Arg).
@@ -1212,7 +1216,7 @@ template <class T, class Tuple> constexpr T *new_from_tuple(Tuple &&t) {
1212
1216
using AdaptativeDefaultFromTypes = AllNodeBaseTypes;
1213
1217
using AdaptativeDefaultToTypes =
1214
1218
TypeList<Decl, Stmt, NestedNameSpecifier, NestedNameSpecifierLoc, TypeLoc,
1215
- QualType>;
1219
+ QualType, Attr >;
1216
1220
1217
1221
// / All types that are supported by HasDeclarationMatcher above.
1218
1222
using HasDeclarationSupportedTypes =
0 commit comments