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:
parent
5343d22eea
commit
8ad690e18a
2 changed files with 11 additions and 1 deletions
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
// {
|
||||
|
|
Loading…
Add table
Reference in a new issue