mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 315525: fix to suppress errors in inner functions
This commit is contained in:
parent
164cdd8a6e
commit
ecf0c62ff0
1 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.codan.core.model.cfg.IControlFlowGraph;
|
|||
import org.eclipse.cdt.codan.core.model.cfg.IExitNode;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTReturnStatement;
|
||||
|
@ -48,10 +49,13 @@ public class ReturnChecker extends AbstractAstFunctionChecker {
|
|||
|
||||
ReturnStmpVisitor(IASTFunctionDefinition func) {
|
||||
shouldVisitStatements = true;
|
||||
shouldVisitDeclarations = true;
|
||||
this.func = func;
|
||||
this.hasret = false;
|
||||
}
|
||||
|
||||
public int visit(IASTDeclaration element) {
|
||||
return PROCESS_SKIP; // skip inner functions
|
||||
}
|
||||
public int visit(IASTStatement stmt) {
|
||||
if (stmt instanceof IASTReturnStatement) {
|
||||
IASTReturnStatement ret = (IASTReturnStatement) stmt;
|
||||
|
|
Loading…
Add table
Reference in a new issue