From 6e4f6e1f06aaca0d1479e324c30162251692a59b Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 25 Jul 2015 15:07:25 +0000 Subject: [AST] Turn the callbacks of lookupInBases and forallBases into a function_ref This lets us pass functors (and lambdas) without void * tricks. On the downside we can't pass CXXRecordDecl's Find* members (which are now type safe) to lookupInBases directly, but a lambda trampoline is a small price to pay. No functionality change intended. llvm-svn: 243217 --- clang/lib/AST/DeclCXX.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'clang/lib/AST/DeclCXX.cpp') diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index d905fcf13a4..32e64b6e4ec 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -385,17 +385,11 @@ void CXXRecordDecl::addedClassSubobject(CXXRecordDecl *Subobj) { } } -/// Callback function for CXXRecordDecl::forallBases that acknowledges -/// that it saw a base class. -static bool SawBase(const CXXRecordDecl *, void *) { - return true; -} - bool CXXRecordDecl::hasAnyDependentBases() const { if (!isDependentContext()) return false; - return !forallBases(SawBase, nullptr); + return !forallBases([](const CXXRecordDecl *) { return true; }); } bool CXXRecordDecl::isTriviallyCopyable() const { -- cgit v1.2.3