Merge pull request #495 from geoffw0/returnvalue

CPP: Fix 'Missing return statement'
This commit is contained in:
Jonas Jensen
2018-11-20 10:16:30 +01:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ predicate functionImperfectlyExtracted(Function f) {
exists(CompilerError e | f.getBlock().getLocation().subsumes(e.getLocation()))
or
exists(ErrorExpr ee | ee.getEnclosingFunction() = f)
or
count(f.getType()) > 1
}
from Stmt stmt, string msg, Function f, ControlFlowNode blame

View File

@@ -84,3 +84,13 @@ int f12(int x)
// ...
}
}
void f13()
{
f13_func(); // implicitly declared here
}
void f13_func(int x)
{
if (x < 10) return; // GOOD
}