mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Revert "Bug 399147 - Make 'Find Reference' find using-declarations"
The change is invalid since a PDOMName can participate in only one
binding at a time through its BINDING_PREV_OFFSET/ BINDING_PREV_OFFSET
pointers.
This reverts commit 2706699543
.
Change-Id: I1a4dd7b189b85a0d9c1cca2660d33ab7351a025c
This commit is contained in:
parent
95e05f485d
commit
5e793c9b43
3 changed files with 1 additions and 25 deletions
|
@ -209,6 +209,6 @@ public class NamespaceTests extends PDOMTestBase {
|
||||||
assertEquals(0, decls.length);
|
assertEquals(0, decls.length);
|
||||||
|
|
||||||
IName[] refs = pdom.findNames(variable1, IIndex.FIND_REFERENCES);
|
IName[] refs = pdom.findNames(variable1, IIndex.FIND_REFERENCES);
|
||||||
assertEquals(3, refs.length);
|
assertEquals(2, refs.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,6 @@ import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIncludeStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDeclaration;
|
|
||||||
import org.eclipse.cdt.core.index.IIndexFile;
|
import org.eclipse.cdt.core.index.IIndexFile;
|
||||||
import org.eclipse.cdt.core.index.IIndexName;
|
import org.eclipse.cdt.core.index.IIndexName;
|
||||||
import org.eclipse.cdt.core.index.IndexLocationFactory;
|
import org.eclipse.cdt.core.index.IndexLocationFactory;
|
||||||
|
@ -79,17 +77,6 @@ public final class PDOMName implements IIndexFragmentName, IASTFileLocation {
|
||||||
break;
|
break;
|
||||||
case IS_DECLARATION:
|
case IS_DECLARATION:
|
||||||
binding.addDeclaration(this);
|
binding.addDeclaration(this);
|
||||||
|
|
||||||
// The name of a using-declaration is, in addition to the declaration of
|
|
||||||
// the using-declaration binding, a reference to its delegate bindings.
|
|
||||||
if (binding instanceof ICPPUsingDeclaration) {
|
|
||||||
for (IBinding delegate : ((ICPPUsingDeclaration) binding).getDelegates()) {
|
|
||||||
if (delegate instanceof PDOMBinding) {
|
|
||||||
((PDOMBinding) delegate).addReference(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case IS_REFERENCE:
|
case IS_REFERENCE:
|
||||||
binding.addReference(this);
|
binding.addReference(this);
|
||||||
|
|
|
@ -126,17 +126,6 @@ public class FindReferencesTest extends SearchTestBase {
|
||||||
assertNotNull(matches[0].getEnclosingElement());
|
assertNotNull(matches[0].getEnclosingElement());
|
||||||
}
|
}
|
||||||
|
|
||||||
// namespace N {
|
|
||||||
// void foo();
|
|
||||||
// }
|
|
||||||
// using N::foo;
|
|
||||||
|
|
||||||
// // empty file
|
|
||||||
public void testUsingDeclaration_399147() throws Exception {
|
|
||||||
CSearchQuery query = makeSearchQuery(fHeaderFile, selectSection("foo", "void foo", fHeaderContents));
|
|
||||||
assertOccurrences(query, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// // empty file
|
// // empty file
|
||||||
|
|
||||||
// namespace { struct A {}; }
|
// namespace { struct A {}; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue