[ASTMatchers] Add own version of VariadicFunction.
Summary:
llvm::VariadicFunction is only being used by ASTMatchers.
Having our own copy here allows us to remove the other one from llvm/ADT.
Also, we can extend the API to meet our needs without modifying the common
implementation.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D18275
llvm-svn: 264417
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
index 713ef5a..fc98373 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp
@@ -3000,6 +3000,9 @@
EXPECT_TRUE(notMatches(Code, recordDecl(hasAnyName("::C", "::b::C"))));
EXPECT_TRUE(
matches(Code, recordDecl(hasAnyName("::C", "::b::C", "::a::b::C"))));
+
+ std::vector<StringRef> Names = {"::C", "::b::C", "::a::b::C"};
+ EXPECT_TRUE(matches(Code, recordDecl(hasAnyName(Names))));
}
TEST(Matcher, IsDefinition) {