summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-07-25 15:07:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-07-25 15:07:25 +0000
commit6e4f6e1f06aaca0d1479e324c30162251692a59b (patch)
tree94e15a16642f28fdd5cfc611291f1ca205489e24 /clang/lib/Sema/SemaDeclAttr.cpp
parent944a5777bba28ff905fd0fae7d29b0eb9200b315 (diff)
downloadbcm5719-llvm-6e4f6e1f06aaca0d1479e324c30162251692a59b.tar.gz
bcm5719-llvm-6e4f6e1f06aaca0d1479e324c30162251692a59b.zip
[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
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 3395381b6a3..64e61b5c388 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -432,11 +432,10 @@ static bool checkRecordTypeForCapability(Sema &S, QualType Ty) {
// Else check if any base classes have a capability.
if (CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD)) {
CXXBasePaths BPaths(false, false);
- if (CRD->lookupInBases([](const CXXBaseSpecifier *BS, CXXBasePath &P,
- void *) {
- return BS->getType()->getAs<RecordType>()
- ->getDecl()->hasAttr<CapabilityAttr>();
- }, nullptr, BPaths))
+ if (CRD->lookupInBases([](const CXXBaseSpecifier *BS, CXXBasePath &) {
+ const auto *Type = BS->getType()->getAs<RecordType>();
+ return Type->getDecl()->hasAttr<CapabilityAttr>();
+ }, BPaths))
return true;
}
return false;
OpenPOWER on IntegriCloud