mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
Fixes two testcases (testCPPSpecDeclsDefs)
This commit is contained in:
parent
f33e52a606
commit
0c0eefcf2b
1 changed files with 6 additions and 7 deletions
|
@ -219,24 +219,23 @@ class PDOMCLinkage extends PDOMLinkage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PDOMBinding resolveBinding(IASTName name) throws CoreException {
|
public PDOMBinding resolveBinding(IASTName name) throws CoreException {
|
||||||
int constant;
|
int[] constants;
|
||||||
IASTNode parent = name.getParent();
|
IASTNode parent = name.getParent();
|
||||||
if (parent instanceof IASTIdExpression) { // reference
|
if (parent instanceof IASTIdExpression) { // reference
|
||||||
IASTNode eParent = parent.getParent();
|
IASTNode eParent = parent.getParent();
|
||||||
if (eParent instanceof IASTFunctionCallExpression) {
|
if (eParent instanceof IASTFunctionCallExpression) {
|
||||||
constant = CFUNCTION;
|
constants = new int[] {CFUNCTION};
|
||||||
} else {
|
} else {
|
||||||
constant = CVARIABLE;
|
constants = new int[] {CVARIABLE, CENUMERATOR};
|
||||||
}
|
}
|
||||||
} else if (parent instanceof ICASTElaboratedTypeSpecifier) {
|
} else if (parent instanceof ICASTElaboratedTypeSpecifier) {
|
||||||
constant = CSTRUCTURE;
|
constants = new int[] {CSTRUCTURE};
|
||||||
} else if (parent instanceof IASTNamedTypeSpecifier){
|
} else if (parent instanceof IASTNamedTypeSpecifier){
|
||||||
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), new int [] {CSTRUCTURE, CENUMERATION, CTYPEDEF});
|
constants= new int [] {CSTRUCTURE, CENUMERATION, CTYPEDEF};
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), constants);
|
||||||
return FindBinding.findBinding(getIndex(), getPDOM(), name.toCharArray(), new int[] {constant});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PDOMNode addType(PDOMNode parent, IType type) throws CoreException {
|
public PDOMNode addType(PDOMNode parent, IType type) throws CoreException {
|
||||||
|
|
Loading…
Add table
Reference in a new issue