Kaydet (Commit) e8b2fc7a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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

Change-Id: I41555c0a2b35ad950797f65e02ed1ee060c4bf0a
üst 1d3ee766
...@@ -79,7 +79,7 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl) ...@@ -79,7 +79,7 @@ bool UnnecessaryOverride::VisitCXXMethodDecl(const CXXMethodDecl* methodDecl)
const CompoundStmt* compoundStmt = dyn_cast<CompoundStmt>(methodDecl->getBody()); const CompoundStmt* compoundStmt = dyn_cast<CompoundStmt>(methodDecl->getBody());
if (!compoundStmt || compoundStmt->size() != 1) if (!compoundStmt || compoundStmt->size() != 1)
return true; return true;
auto returnStmt = dyn_cast<ReturnStmt>(compoundStmt->body_front()); auto returnStmt = dyn_cast<ReturnStmt>(*compoundStmt->body_begin());
if (returnStmt == nullptr) { if (returnStmt == nullptr) {
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment