From f901b719214d0bd4d42d85e9b5bbbc95d1ee3479 Mon Sep 17 00:00:00 2001 From: Edwin Vane Date: Mon, 25 Feb 2013 14:49:29 +0000 Subject: Adding hasDeclaration overload for TemplateSpecializationType TemplateSpecializationType doesn't quite have getDecl(). Need to go through TemplateName to get a TemplateDecl. Added test cases for the hasDeclaration() overload for TemplateSpecializationType. Also introduced the type matcher templateSpecializationType() used by the new hasDeclaration() test case. Updated LibASTMatchersReference. Reviewers: klimek llvm-svn: 176025 --- clang/docs/LibASTMatchersReference.html | 79 ++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 15 deletions(-) (limited to 'clang/docs/LibASTMatchersReference.html') diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 3ee44cfe11d..8afb1639e54 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -987,6 +987,21 @@ pointerType() +Matcher<TypeLoc>templateSpecializationTypeLocMatcher<TemplateSpecializationTypeLoc>... +
Matches template specialization types.
+
+Given
+  template <typename T>
+  class C { };
+
+  template class C<int>;  A
+  C<char> var;            B
+
+templateSpecializationType() matches the type of the explicit
+instantiation in A and the type of the variable declaration in B.
+
+ + Matcher<TypeLoc>typeLocMatcher<TypeLoc>...
Matches TypeLocs in the clang AST.
 
@@ -1166,6 +1181,21 @@ pointerType() +Matcher<Type>templateSpecializationTypeMatcher<TemplateSpecializationType>... +
Matches template specialization types.
+
+Given
+  template <typename T>
+  class C { };
+
+  template class C<int>;  A
+  C<char> var;            B
+
+templateSpecializationType() matches the type of the explicit
+instantiation in A and the type of the variable declaration in B.
+
+ + Matcher<Type>typeMatcher<Type>...
Matches Types in the clang AST.
 
@@ -2034,8 +2064,8 @@ Usable as: Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
 In addition to being usable as Matcher<TypedefType>, also usable as
@@ -2043,7 +2073,8 @@ Matcher<T> for any T supporting the getDecl() member function. e.g. variou
 subtypes of clang::Type.
 
 Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<MemberExpr>, Matcher<TypedefType>
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
 
@@ -2189,8 +2220,8 @@ Example matches y in x(y)
-Matcher<CallExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<CallExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
 In addition to being usable as Matcher<TypedefType>, also usable as
@@ -2198,7 +2229,8 @@ Matcher<T> for any T supporting the getDecl() member function. e.g. variou
 subtypes of clang::Type.
 
 Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<MemberExpr>, Matcher<TypedefType>
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
 
@@ -2586,8 +2618,8 @@ FIXME: Unit test this matcher
-Matcher<MemberExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<MemberExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
 In addition to being usable as Matcher<TypedefType>, also usable as
@@ -2595,7 +2627,8 @@ Matcher<T> for any T supporting the getDecl() member function. e.g. variou
 subtypes of clang::Type.
 
 Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<MemberExpr>, Matcher<TypedefType>
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
 
@@ -2756,8 +2789,8 @@ Usable as: Matcher<QualType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<QualType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
 In addition to being usable as Matcher<TypedefType>, also usable as
@@ -2765,7 +2798,8 @@ Matcher<T> for any T supporting the getDecl() member function. e.g. variou
 subtypes of clang::Type.
 
 Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<MemberExpr>, Matcher<TypedefType>
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
 
@@ -2850,14 +2884,28 @@ classTemplateSpecializationDecl(hasAnyTemplateArgument(
+Matcher<TemplateSpecializationType>hasDeclarationMatcher<Decl> InnerMatcher +
Matches a type if the declaration of the type matches the given
+matcher.
+
+In addition to being usable as Matcher<TypedefType>, also usable as
+Matcher<T> for any T supporting the getDecl() member function. e.g. various
+subtypes of clang::Type.
+
+Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
+
+ + Matcher<TypeLoc>locMatcher<QualType> InnerMatcher
Matches TypeLocs for which the given inner
 QualType-matcher matches.
 
-Matcher<TypedefType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<TypedefType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
 In addition to being usable as Matcher<TypedefType>, also usable as
@@ -2865,7 +2913,8 @@ Matcher<T> for any T supporting the getDecl() member function. e.g. variou
 subtypes of clang::Type.
 
 Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
-  Matcher<MemberExpr>, Matcher<TypedefType>
+  Matcher<MemberExpr>, Matcher<TypedefType>,
+  Matcher<TemplateSpecializationType>
 
-- cgit v1.2.3