Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlena Laskavaia2011-05-01 17:14:42 -0400
committerAlena Laskavaia2011-05-01 17:14:42 -0400
commita63a62bc4fbe55ac8c5b7a4c4dc4398a5f25c58f (patch)
treec6382fb0cbd7ca89a4795357c045cab3e29afbae /codan/org.eclipse.cdt.codan.core.test
parenta0ff5b6b4f71587ceec32644b32288a584617bf9 (diff)
downloadorg.eclipse.cdt-a63a62bc4fbe55ac8c5b7a4c4dc4398a5f25c58f.tar.gz
org.eclipse.cdt-a63a62bc4fbe55ac8c5b7a4c4dc4398a5f25c58f.tar.xz
org.eclipse.cdt-a63a62bc4fbe55ac8c5b7a4c4dc4398a5f25c58f.zip
Bug 343767 - [fp] 'No return' warning when return in both if and else
Diffstat (limited to 'codan/org.eclipse.cdt.codan.core.test')
-rw-r--r--codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
index d9174dd00e..9169ac64a9 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java
@@ -245,4 +245,14 @@ public class ReturnCheckerTest extends CheckerTestCase {
loadCodeAndRunCpp(getAboveComment());
checkNoErrors();
}
+ //int bar(int foo)
+ //{
+ // while(foo) {
+ // return 0;
+ // }
+ //}
+ public void testWhile() {
+ loadCodeAndRunCpp(getAboveComment());
+ checkErrorLine(1);
+ }
} \ No newline at end of file

Back to the top