Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2011-08-28 23:35:50 -0400
committerSergey Prigogin2011-08-28 23:45:15 -0400
commit17f96f9eb3a4f54696e76b19bfb4cbe9ed0fe8fb (patch)
tree63589b7bf6adb5815965b45de00b3c42f9f414d0 /codan/org.eclipse.cdt.codan.core.test
parentc0b9f79b300f27293e507c7c050afe4befa86928 (diff)
downloadorg.eclipse.cdt-17f96f9eb3a4f54696e76b19bfb4cbe9ed0fe8fb.tar.gz
org.eclipse.cdt-17f96f9eb3a4f54696e76b19bfb4cbe9ed0fe8fb.tar.xz
org.eclipse.cdt-17f96f9eb3a4f54696e76b19bfb4cbe9ed0fe8fb.zip
Bug 356040 - Invalid "Unused declaration of variable" warning.
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/UnusedSymbolInFileScopeCheckerTest.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
index 7206e8b785..4cd1d7964f 100644
--- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
+++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java
@@ -6,7 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Andrew Gvozdev - initial API and implementation
+ * Andrew Gvozdev - initial API and implementation
+ * Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.codan.core.internal.checkers;
@@ -17,7 +18,6 @@ import org.eclipse.cdt.codan.internal.checkers.UnusedSymbolInFileScopeChecker;
/**
* Test for {@see UnusedSymbolInFileScopeChecker} class
- *
*/
public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
@Override
@@ -222,8 +222,15 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase {
checkNoErrors();
}
- // extern int test_var=0; // not quite legal but some compilers allow that
- public void testExternVariable_Definition() throws IOException {
+ // extern const int test_var=0; // not quite legal but some compilers allow that
+ public void testExternVariable_Definition1() throws IOException {
+ loadCodeAndRun(getAboveComment());
+ checkNoErrors();
+ }
+
+ // extern const int test_var;
+ // const int test_var = 0;
+ public void testExternVariable_Definition2() throws IOException {
loadCodeAndRun(getAboveComment());
checkNoErrors();
}

Back to the top