1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 345687 - [fp] "No return, in function returning non-void" for

compound statement at the end
This commit is contained in:
Tomasz Wesolowski 2011-06-27 20:29:36 -04:00 committed by Alena Laskavaia
parent 5343d22eea
commit 8ad690e18a
2 changed files with 11 additions and 1 deletions

View file

@ -192,7 +192,7 @@ public class ReturnChecker extends AbstractAstFunctionChecker {
*/
private boolean isCompoundStatement(IASTStatement last) {
return last instanceof IASTIfStatement || last instanceof IASTWhileStatement || last instanceof IASTDoStatement
|| last instanceof IASTForStatement || last instanceof IASTSwitchStatement;
|| last instanceof IASTForStatement || last instanceof IASTSwitchStatement || last instanceof IASTCompoundStatement;
}
protected boolean isFuncExitStatement(IASTStatement statement) {

View file

@ -256,6 +256,16 @@ public class ReturnCheckerTest extends CheckerTestCase {
checkErrorLine(1);
}
// int f345687() {
// {
// return 0;
// }
// }
public void testNextedBlock_Bug345687() {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
// int
// fp_goto(int a)
// {