diff options
author | Samuel Benzaquen <sbenza@google.com> | 2013-08-27 16:55:22 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2013-08-27 16:55:22 +0000 |
commit | 46e59b05eb4248357022f930583ff9640cf6a58c (patch) | |
tree | 0c01b07e902afe1ee765e8e4e31d403d5f106828 /clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp | |
parent | f02a3c599bf1974da857854d279622c6e2455868 (diff) | |
download | bcm5719-llvm-46e59b05eb4248357022f930583ff9640cf6a58c.tar.gz bcm5719-llvm-46e59b05eb4248357022f930583ff9640cf6a58c.zip |
Revert "Add support for eachOf/allOf/anyOf variadic matchers in the dynamic layer."
Summary:
This reverts commit 3b082a3c72324aa3363b5184731740534c6b9a2b.
It breaks the build in c++11 mode.
Reviewers: klimek
CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1533
llvm-svn: 189368
Diffstat (limited to 'clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp')
-rw-r--r-- | clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp index 874a4f35a0b..55490a5bab9 100644 --- a/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp +++ b/clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp @@ -261,33 +261,6 @@ TEST_F(RegistryTest, Adaptative) { EXPECT_FALSE(matches("void foo() { if (true) return; }", S)); } -TEST_F(RegistryTest, VariadicOp) { - Matcher<Decl> D = constructMatcher( - "anyOf", constructMatcher("recordDecl"), - constructMatcher("namedDecl", - constructMatcher("hasName", std::string("foo")))) - .getTypedMatcher<Decl>(); - - EXPECT_TRUE(matches("void foo(){}", D)); - EXPECT_TRUE(matches("struct Foo{};", D)); - EXPECT_FALSE(matches("int i = 0;", D)); - - D = constructMatcher( - "allOf", constructMatcher("recordDecl"), - constructMatcher( - "namedDecl", - constructMatcher("anyOf", - constructMatcher("hasName", std::string("Foo")), - constructMatcher("hasName", std::string("Bar"))))) - .getTypedMatcher<Decl>(); - - EXPECT_FALSE(matches("void foo(){}", D)); - EXPECT_TRUE(matches("struct Foo{};", D)); - EXPECT_FALSE(matches("int i = 0;", D)); - EXPECT_TRUE(matches("class Bar{};", D)); - EXPECT_FALSE(matches("class OtherBar{};", D)); -} - TEST_F(RegistryTest, Errors) { // Incorrect argument count. OwningPtr<Diagnostics> Error(new Diagnostics()); @@ -312,24 +285,6 @@ TEST_F(RegistryTest, Errors) { EXPECT_EQ("Incorrect type for arg 2. (Expected = Matcher<CXXRecordDecl>) != " "(Actual = Matcher<FunctionDecl>)", Error->toString()); - - // Bad argument type with variadic. - Error.reset(new Diagnostics()); - EXPECT_TRUE(constructMatcher("anyOf", std::string(), Error.get()).isNull()); - EXPECT_EQ( - "Incorrect type for arg 1. (Expected = Matcher<>) != (Actual = String)", - Error->toString()); - Error.reset(new Diagnostics()); - EXPECT_TRUE(constructMatcher( - "recordDecl", - constructMatcher("allOf", - constructMatcher("isDerivedFrom", std::string("FOO")), - constructMatcher("isArrow")), - Error.get()).isNull()); - EXPECT_EQ("Incorrect type for arg 1. " - "(Expected = Matcher<CXXRecordDecl>) != " - "(Actual = Matcher<CXXRecordDecl>&Matcher<MemberExpr>)", - Error->toString()); } } // end anonymous namespace |