mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
188324: apply fix
This commit is contained in:
parent
2a67c5a321
commit
59db7018c7
3 changed files with 19 additions and 8 deletions
|
@ -69,9 +69,7 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
|
||||||
protected ITestStrategy strategy;
|
protected ITestStrategy strategy;
|
||||||
|
|
||||||
public void setStrategy(ITestStrategy strategy) {
|
public void setStrategy(ITestStrategy strategy) {
|
||||||
if(this.strategy==null) {
|
this.strategy = strategy;
|
||||||
this.strategy = strategy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
|
|
|
@ -54,6 +54,18 @@ public class IndexCPPBindingResolutionBugs extends IndexBindingResolutionTestBas
|
||||||
setStrategy(new SinglePDOMTestStrategy(true));
|
setStrategy(new SinglePDOMTestStrategy(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// namespace ns {class A{};}
|
||||||
|
|
||||||
|
// ns::A a;
|
||||||
|
// class B {};
|
||||||
|
public void test188324() throws Exception {
|
||||||
|
IASTName name= findNames("B", 1)[0];
|
||||||
|
IBinding b0= getBindingFromASTName("ns::A", 2);
|
||||||
|
assertInstance(b0, ICPPNamespace.class);
|
||||||
|
ICPPNamespace ns= (ICPPNamespace) b0;
|
||||||
|
assertEquals(0, ns.getNamespaceScope().getBindings(name, false, false).length);
|
||||||
|
}
|
||||||
|
|
||||||
// template<typename T>
|
// template<typename T>
|
||||||
// class C : public C<T> {};
|
// class C : public C<T> {};
|
||||||
|
|
||||||
|
|
|
@ -90,13 +90,14 @@ public abstract class CompositeScope implements IIndexScope {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A convenience method for processing an array of bindings with {@link CompositeScope#processUncertainBinding(IBinding)}
|
* A convenience method for processing an array of bindings with {@link CompositeScope#processUncertainBinding(IBinding)}
|
||||||
* @param fragmentBindings
|
* Returns an empty array if the input parameter is null
|
||||||
* @return
|
* @param frgBindings
|
||||||
|
* @return a non-null IBinding[]
|
||||||
*/
|
*/
|
||||||
protected final IBinding[] processUncertainBindings(IBinding[] fragmentBindings) {
|
protected final IBinding[] processUncertainBindings(IBinding[] frgBindings) {
|
||||||
IBinding[] result= new IBinding[fragmentBindings.length];
|
IBinding[] result= new IBinding[frgBindings==null ? 0 : frgBindings.length];
|
||||||
for(int i=0; i<result.length; i++) {
|
for(int i=0; i<result.length; i++) {
|
||||||
result[i]= processUncertainBinding(fragmentBindings[i]);
|
result[i]= processUncertainBinding(frgBindings[i]);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue