summaryrefslogtreecommitdiffstats
path: root/clang/unittests/ASTMatchers/ASTMatchersTest.h
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-09-04 18:34:48 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-09-04 18:34:48 +0000
commitc129c691052446a1d1801280a436c09cded4f484 (patch)
tree08eeb1e77348dca36434988efc48aa075886ada0 /clang/unittests/ASTMatchers/ASTMatchersTest.h
parent23a4df27abc1afe8512a66b5a1f6ac1112f12316 (diff)
downloadbcm5719-llvm-c129c691052446a1d1801280a436c09cded4f484.tar.gz
bcm5719-llvm-c129c691052446a1d1801280a436c09cded4f484.zip
Fixing a bug where hasType(decl()) would fail to match on C code involving structs or unions.
llvm-svn: 246860
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.h')
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTest.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.h b/clang/unittests/ASTMatchers/ASTMatchersTest.h
index 403a305db24..285d2630cea 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.h
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.h
@@ -120,6 +120,12 @@ testing::AssertionResult matchesObjC(const std::string &Code,
}
template <typename T>
+testing::AssertionResult matchesC(const std::string &Code, const T &AMatcher) {
+ return matchesConditionally(Code, AMatcher, true, "", FileContentMappings(),
+ "input.c");
+}
+
+template <typename T>
testing::AssertionResult notMatchesObjC(const std::string &Code,
const T &AMatcher) {
return matchesConditionally(
OpenPOWER on IntegriCloud