Index: docs/LibASTMatchersReference.html =================================================================== --- docs/LibASTMatchersReference.html +++ docs/LibASTMatchersReference.html @@ -3758,8 +3758,8 @@ -Matcher<AddrLabelExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<AddrLabelExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -3772,13 +3772,13 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
@@ -4004,13 +4004,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>
@@ -4174,8 +4174,8 @@ -Matcher<CXXNewExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<CXXNewExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -4188,13 +4188,13 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
@@ -4323,13 +4323,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>
@@ -4438,8 +4438,8 @@ -Matcher<DeclRefExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<DeclRefExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -4452,13 +4452,13 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
@@ -4602,8 +4602,8 @@
-Matcher<EnumType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<EnumType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -4616,13 +4616,13 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
@@ -4934,8 +4934,8 @@
-Matcher<InjectedClassNameType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<InjectedClassNameType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -4948,18 +4948,18 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
-Matcher<LabelStmt>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<LabelStmt>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -4972,13 +4972,13 @@
 Also usable as Matcher<T> for any T supporting the getDecl() member
 function. e.g. various subtypes of clang::Type and various expressions.
 
-Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<CXXNewExpr>,
-  Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>,
-  Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>,
-  Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>,
-  Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>,
-  Matcher<TypedefType>, Matcher<UnresolvedUsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>
 
@@ -4996,13 +4996,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>
@@ -5256,13 +5256,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>
@@ -5328,13 +5328,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> @@ -5457,13 +5457,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> @@ -5570,13 +5570,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> @@ -5614,13 +5614,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> @@ -5667,13 +5667,25 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> + + + +Matcher<Type>hasUnqualifiedDesugaredTypeMatcher<Type> InnerMatcher +
Matches if the matched type matches the unqualified desugared
+type of the matched node.
+
+For example, in:
+  class A {};
+  using B = A;
+The matcher type(hasUniqualifeidDesugaredType(recordType())) matches
+both B and A.
 
@@ -5710,13 +5722,13 @@ Also usable as Matcher<T> for any T supporting the getDecl() member function. e.g. various subtypes of clang::Type and various expressions. -Usable as: Matcher<CallExpr>, Matcher<CXXConstructExpr>, - Matcher<CXXNewExpr>, - Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, - Matcher<LabelStmt>, Matcher<AddrLabelExpr>, Matcher<MemberExpr>, - Matcher<QualType>, Matcher<RecordType>, Matcher<TagType>, - Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, - Matcher<TypedefType>, Matcher<UnresolvedUsingType> +Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, + Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType> Index: include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- include/clang/ASTMatchers/ASTMatchers.h +++ include/clang/ASTMatchers/ASTMatchers.h @@ -2738,6 +2738,22 @@ .matches(Node, Finder, Builder); } +/// \brief Matches if the matched type matches the unqualified desugared +/// type of the matched node. +/// +/// For example, in: +/// \code +/// class A {}; +/// using B = A; +/// \endcode +/// The matcher type(hasUniqualifeidDesugaredType(recordType())) matches +/// both B and A. +AST_MATCHER_P(Type, hasUnqualifiedDesugaredType, internal::Matcher, + InnerMatcher) { + return InnerMatcher.matches(*Node.getUnqualifiedDesugaredType(), Finder, + Builder); +} + /// \brief Matches if the matched type is a reference type and the referenced /// type matches the specified matcher. /// Index: lib/ASTMatchers/Dynamic/Registry.cpp =================================================================== --- lib/ASTMatchers/Dynamic/Registry.cpp +++ lib/ASTMatchers/Dynamic/Registry.cpp @@ -270,6 +270,7 @@ REGISTER_MATCHER(hasUnaryOperand); REGISTER_MATCHER(hasUnarySelector); REGISTER_MATCHER(hasUnderlyingDecl); + REGISTER_MATCHER(hasUnqualifiedDesugaredType); REGISTER_MATCHER(hasValueType); REGISTER_MATCHER(ifStmt); REGISTER_MATCHER(ignoringImplicit); Index: unittests/ASTMatchers/ASTMatchersTraversalTest.cpp =================================================================== --- unittests/ASTMatchers/ASTMatchersTraversalTest.cpp +++ unittests/ASTMatchers/ASTMatchersTraversalTest.cpp @@ -247,6 +247,15 @@ cxxNewExpr(hasDeclaration(functionDecl(parameterCountIs(1)))))); } +TEST(HasUnqualifiedDesugaredType, DesugarsUsing) { + EXPECT_TRUE( + matches("struct A {}; using B = A; B b;", + varDecl(hasType(hasUnqualifiedDesugaredType(recordType()))))); + EXPECT_TRUE( + matches("struct A {}; using B = A; using C = B; C b;", + varDecl(hasType(hasUnqualifiedDesugaredType(recordType()))))); +} + TEST(HasUnderlyingDecl, Matches) { EXPECT_TRUE(matches("namespace N { template void f(T t); }" "template void g() { using N::f; f(T()); }",