]> granicus.if.org Git - clang/commit
Change the behavior of the isDerivedFrom-matcher to not match on the
authorDaniel Jasper <djasper@google.com>
Fri, 7 Sep 2012 12:48:17 +0000 (12:48 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 7 Sep 2012 12:48:17 +0000 (12:48 +0000)
commit76dafa7e6487c0b51fadebd16bdefe0e0e23d595
tree543d26320d7a6526a4e0baa76227d5cd87644049
parent579b120038ca817e0ce423303ebc1b4e0c6cbbe1
Change the behavior of the isDerivedFrom-matcher to not match on the
class itself. This caused some confusion (intuitively, a class is not
derived from itself) and makes it hard to write certain matchers, e.g.
"match and bind any pair of base and subclass".

The original behavior can be achieved with a new isA-matcher.  Similar
to all other matchers, this matcher has the same behavior and name as
the corresponding AST-entity - in this case the isa<>() function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163385 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/ASTMatchFinder.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp