Adapt to older Clang that don't have CompoundStmt::body_front

Change-Id: I41555c0a2b35ad950797f65e02ed1ee060c4bf0a
This commit is contained in:
Stephan Bergmann
2016-07-18 11:46:41 +02:00
parent 1d3ee7663d
commit e8b2fc7a92

View File

@@ -79,7 +79,7 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
const CompoundStmt* compoundStmt = dyn_cast<CompoundStmt>(methodDecl->getBody());
if (!compoundStmt || compoundStmt->size() != 1)
return true;
auto returnStmt = dyn_cast<ReturnStmt>(compoundStmt->body_front());
auto returnStmt = dyn_cast<ReturnStmt>(*compoundStmt->body_begin());
if (returnStmt == nullptr) {
return true;
}