Adapt to older Clang that don't have CompoundStmt::body_front
Change-Id: I41555c0a2b35ad950797f65e02ed1ee060c4bf0a
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user