From: Edwin Vane Date: Mon, 25 Feb 2013 14:09:28 +0000 (+0000) Subject: Reverting r176019. Corrupt patch. X-Git-Tag: llvmorg-3.3.0-rc1~4625 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0dfa07b44068f16c489601b74260d0cc6ca1275;p=platform%2Fupstream%2Fllvm.git Reverting r176019. Corrupt patch. llvm-svn: 176021 --- diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index cdbde76247f1..e18e32594226 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -353,23 +353,6 @@ inline Matcher makeMatcher(MatcherInterface *Implementation) { return Matcher(Implementation); } -/// \brief Metafunction to determine if type T has a member called getDecl. -template struct has_getDecl { - struct Default { int getDecl; }; - struct Derived : T, Default { }; - - template struct CheckT; - - // If T::getDecl exists, an ambiguity arises and CheckT will - // not be instantiable. This makes f(...) the only available - // overload. - template - static char (&f(CheckT*))[1]; - template static char (&f(...))[2]; - - static bool const value = sizeof(f(0)) == 2; -}; - /// \brief Matches declarations for QualType and CallExpr. /// /// Type argument DeclMatcherT is required by PolymorphicMatcherWithParam1 but @@ -393,13 +376,11 @@ private: /// \brief If getDecl exists as a member of U, returns whether the inner /// matcher matches Node.getDecl(). template - bool matchesSpecialized( - const U &Node, ASTMatchFinder *Finder, BoundNodesTreeBuilder *Builder, - typename llvm::enable_if, int>::type = 0) const { + bool matchesSpecialized(const U &Node, ASTMatchFinder *Finder, + BoundNodesTreeBuilder *Builder) const { return matchesDecl(Node.getDecl(), Finder, Builder); } - /// \brief Extracts the CXXRecordDecl or EnumDecl of a QualType and returns /// whether the inner matcher matches on it. bool matchesSpecialized(const QualType &Node, ASTMatchFinder *Finder, @@ -412,15 +393,6 @@ private: return matchesDecl(Node->getAsCXXRecordDecl(), Finder, Builder); } - /// \brief Gets the TemplateDecl from a TemplateSpecializationType - /// and returns whether the inner matches on it. - bool matchesSpecialized(const TemplateSpecializationType &Node, - ASTMatchFinder *Finder, - BoundNodesTreeBuilder *Builder) const { - return matchesDecl(Node.getTemplateName().getAsTemplateDecl(), - Finder, Buidler); - } - /// \brief Extracts the Decl of the callee of a CallExpr and returns whether /// the inner matcher matches on it. bool matchesSpecialized(const CallExpr &Node, ASTMatchFinder *Finder, diff --git a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp index a759df9070f5..63017473f427 100644 --- a/clang/unittests/ASTMatchers/ASTMatchersTest.cpp +++ b/clang/unittests/ASTMatchers/ASTMatchersTest.cpp @@ -818,12 +818,6 @@ TEST(HasDeclaration, HasDeclarationOfEnumType) { qualType(hasDeclaration(enumDecl(hasName("X"))))))))); } -TEST(HasDeclaration, HasGetDeclTraitTest) { - EXPECT_TRUE(internal::has_getDecl::value); - EXPECT_TRUE(internal::has_getDecl::value); - EXPECT_FALSE(internal::has_getDecl::value); -} - TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) { EXPECT_TRUE(matches("typedef int X; X a;", varDecl(hasName("a"),