Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2014-11-18 23:37:52 -0500
committerSergey Prigogin2014-11-18 23:37:52 -0500
commit76087768813b65568bf09ade5288fc088f79b20f (patch)
tree968d40a38d9b6615a4cba7306d70b238253d4fb1
parenta3e3cec9c1ed8905ac7b84543b3e5954cf26bf4d (diff)
downloadorg.eclipse.cdt-76087768813b65568bf09ade5288fc088f79b20f.tar.gz
org.eclipse.cdt-76087768813b65568bf09ade5288fc088f79b20f.tar.xz
org.eclipse.cdt-76087768813b65568bf09ade5288fc088f79b20f.zip
Bug 450888 - Index update problem caused by applying significant macros
to a source file
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTests.java1
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateMultiFileTest.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java7
3 files changed, 5 insertions, 10 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTests.java
index 46cc2377612..58e0109ee37 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTests.java
@@ -27,6 +27,7 @@ public class IndexTests extends TestSuite {
suite.addTest(IndexSearchTest.suite());
suite.addTest(IndexIncludeTest.suite());
suite.addTest(IndexUpdateTests.suite());
+ suite.addTest(IndexUpdateMultiFileTest.suite());
suite.addTest(IndexBugsTests.suite());
suite.addTest(IndexNamesTests.suite());
suite.addTest(TeamSharedIndexTest.suite());
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateMultiFileTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateMultiFileTest.java
index fbca108b6f2..41f28a49886 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateMultiFileTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexUpdateMultiFileTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 Google, Inc and others.
+ * Copyright (c) 2014 Google, Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -68,8 +68,7 @@ public class IndexUpdateMultiFileTest extends IndexBindingResolutionTestBase {
// waldo(new B<E>());
// }
// };
- public void test_450888() throws Exception {
- getProblemFromFirstIdentifier("waldo");
-// checkBindings();
+ public void testMacroRemoval_450888() throws Exception {
+ checkBindings();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
index 6eb847dd8f1..1947c5f0159 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/WritablePDOM.java
@@ -22,7 +22,6 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
-import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.index.IIndexFile;
import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IIndexInclude;
@@ -322,11 +321,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
if (owner != null)
return owner.getSignificantMacros();
- IASTTranslationUnit tu = node.getTranslationUnit();
- if (tu != null)
- return tu.getSignificantMacros();
-
- return null;
+ return ISignificantMacros.NONE;
}
@Override

Back to the top