r175837 - Removing has_getDecl (added in r175532). It cause a build break for MSVC, and was not yet being used in the codebase. If we start using std::enable_if, we can look into resurrecting the idea in a more portable fashion.
Aaron Ballman
aaron at aaronballman.com
Thu Feb 21 16:15:31 PST 2013
Author: aaronballman
Date: Thu Feb 21 18:15:31 2013
New Revision: 175837
URL: http://llvm.org/viewvc/llvm-project?rev=175837&view=rev
Log:
Removing has_getDecl (added in r175532). It cause a build break for MSVC, and was not yet being used in the codebase. If we start using std::enable_if, we can look into resurrecting the idea in a more portable fashion.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=175837&r1=175836&r2=175837&view=diff
==============================================================================
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original)
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Thu Feb 21 18:15:31 2013
@@ -353,18 +353,6 @@ inline Matcher<T> makeMatcher(MatcherInt
return Matcher<T>(Implementation);
}
-/// \brief Metafunction to determine if type T has a member called getDecl.
-template <typename T> struct has_getDecl {
- typedef char yes[1];
- typedef char no[2];
-
- template <typename TestType>
- static yes &test(char[sizeof(&TestType::getDecl)]);
- template <typename> static no &test(...);
-
- static bool const value = sizeof(test<T>(0)) == sizeof(yes);
-};
-
/// \brief Matches declarations for QualType and CallExpr.
///
/// Type argument DeclMatcherT is required by PolymorphicMatcherWithParam1 but
@@ -388,9 +376,8 @@ private:
/// \brief If getDecl exists as a member of U, returns whether the inner
/// matcher matches Node.getDecl().
template <typename U>
- bool matchesSpecialized(
- const U &Node, ASTMatchFinder *Finder, BoundNodesTreeBuilder *Builder,
- typename llvm::enable_if<has_getDecl<U>, int>::type = 0) const {
+ bool matchesSpecialized(const U &Node, ASTMatchFinder *Finder,
+ BoundNodesTreeBuilder *Builder) const {
return matchesDecl(Node.getDecl(), Finder, Builder);
}
More information about the cfe-commits
mailing list