Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Marr2014-04-25 19:50:00 -0400
committerElena Laskavaia2014-06-19 16:51:14 -0400
commitfcd66c7d04b669b53721305476daaa5fae551d6c (patch)
tree6def5ee40aa6e41939e2dfc58957a9b853cf7dee /codan/org.eclipse.cdt.codan.core.test
parente35ccf64a8422ea107dd974a9352f3990375cf27 (diff)
downloadorg.eclipse.cdt-fcd66c7d04b669b53721305476daaa5fae551d6c.tar.gz
org.eclipse.cdt-fcd66c7d04b669b53721305476daaa5fae551d6c.tar.xz
org.eclipse.cdt-fcd66c7d04b669b53721305476daaa5fae551d6c.zip
Bug 433357 - Added fix for false positives from GNU
Statement-Expressions Change-Id: I21eb9978a156f2375e5b9e1992c297e3b6ca78ac Signed-off-by: Chris Marr <cdabone@gmail.com> Reviewed-on: https://git.eclipse.org/r/25600 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Hudson CI Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
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/StatementHasNoEffectCheckerTest.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
index 80481aae62..b9c30290bf 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/StatementHasNoEffectCheckerTest.java
@@ -88,13 +88,22 @@ public class StatementHasNoEffectCheckerTest extends CheckerTestCase {
// main() {
// int a=({foo();a;}); // no error here on line 2
+ // char *p=({char s[]="Some string";&s[0];}); // no error here on line 3
// }
- public void testGNUExpressionCompoundStmt() {
+ public void testGNUExpressionCompoundStmtFalsePositives() {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}
// main() {
+ // int z=({int a=0; +a; a;}) // error here on line 2
+ // }
+ public void testGNUExpressionCompoundStmtInside() {
+ loadCodeAndRun(getAboveComment());
+ checkErrorLine(2);
+ }
+
+ // main() {
// int a;
// +a; // error here on line 3
// }

Back to the top