Fixed HasDeclarationMatcher to properly convert all types into decls where possible...
authorAaron Ballman <aaron@aaronballman.com>
Fri, 11 Sep 2015 11:51:24 +0000 (11:51 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 11 Sep 2015 11:51:24 +0000 (11:51 +0000)
commitb85be665b0b2bbe6d21452831e21f8e7ea89b6d5
tree44e4c9506ee6e42d229294e26a5522b8bff98f05
parent13ce0fd140962eca0b32ee1a5bef6e05e4f312e7
Fixed HasDeclarationMatcher to properly convert all types into decls where possible. Added objcObjectPointerType(), objcInterfaceDecl(), templateTypeParmType(), injectedClassNameType(), and unresolvedUsingTypenameDecl(). Updated documentation for pointerType() to call out that it does not match ObjCObjectPointerType types. Changed pointsTo() to handle ObjCObjectPointerType as well as PointerType.

While this may seem like a lot of unrelated changes, they all relate back to fixing HasDeclarationMatcher.

This now allows us to write a matcher like:

varDecl(hasType(namedDecl(hasName("Foo"))))

that matches code using typedefs, objc interfaces, template type parameters, injected class names, or unresolved using typenames.

llvm-svn: 247404
clang/docs/LibASTMatchersReference.html
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/include/clang/ASTMatchers/ASTMatchersInternal.h
clang/lib/ASTMatchers/Dynamic/Registry.cpp
clang/unittests/ASTMatchers/ASTMatchersTest.cpp