diff options
Diffstat (limited to 'clang/unittests/ASTMatchers/ASTMatchersTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/ASTMatchersTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index 3fbe896a87b..e074c6ecc05 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -377,6 +377,11 @@ TEST(DeclarationMatcher, hasDeclContext) { hasName("M"), hasDeclContext(namespaceDecl())))))); } +TEST(DeclarationMatcher, LinkageSpecification) { + EXPECT_TRUE(matches("extern \"C\" { void foo() {}; }", linkageSpecDecl())); + EXPECT_TRUE(notMatches("void foo() {};", linkageSpecDecl())); +} + TEST(ClassTemplate, DoesNotMatchClass) { DeclarationMatcher ClassX = classTemplateDecl(hasName("X")); EXPECT_TRUE(notMatches("class X;", ClassX)); |