mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
more problem bindings in C
This commit is contained in:
parent
cd54f2cfa5
commit
f45b9b7692
1 changed files with 9 additions and 10 deletions
|
@ -1505,22 +1505,21 @@ public class CVisitor {
|
||||||
return new CBasicType((ICASTSimpleDeclSpecifier)declSpec);
|
return new CBasicType((ICASTSimpleDeclSpecifier)declSpec);
|
||||||
}
|
}
|
||||||
IBinding binding = null;
|
IBinding binding = null;
|
||||||
|
IASTName name = null;
|
||||||
if( declSpec instanceof ICASTTypedefNameSpecifier ){
|
if( declSpec instanceof ICASTTypedefNameSpecifier ){
|
||||||
ICASTTypedefNameSpecifier nameSpec = (ICASTTypedefNameSpecifier) declSpec;
|
name = ((ICASTTypedefNameSpecifier) declSpec).getName();
|
||||||
binding = nameSpec.getName().resolveBinding();
|
|
||||||
} else if( declSpec instanceof IASTElaboratedTypeSpecifier ){
|
} else if( declSpec instanceof IASTElaboratedTypeSpecifier ){
|
||||||
IASTElaboratedTypeSpecifier elabTypeSpec = (IASTElaboratedTypeSpecifier) declSpec;
|
name = ((IASTElaboratedTypeSpecifier) declSpec).getName();
|
||||||
binding = elabTypeSpec.getName().resolveBinding();
|
|
||||||
} else if( declSpec instanceof IASTCompositeTypeSpecifier ){
|
} else if( declSpec instanceof IASTCompositeTypeSpecifier ){
|
||||||
IASTCompositeTypeSpecifier compTypeSpec = (IASTCompositeTypeSpecifier) declSpec;
|
name = ((IASTCompositeTypeSpecifier) declSpec).getName(); }
|
||||||
binding = compTypeSpec.getName().resolveBinding();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
binding = name.resolveBinding();
|
||||||
if( binding instanceof IType )
|
if( binding instanceof IType )
|
||||||
return (IType) binding;
|
return (IType) binding;
|
||||||
|
|
||||||
//TODO IProblem
|
if( binding != null )
|
||||||
return null;
|
return new ProblemBinding( name, IProblemBinding.SEMANTIC_INVALID_TYPE, name.toCharArray() );
|
||||||
|
return new ProblemBinding( name, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, name.toCharArray() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IType createType( IASTDeclSpecifier declSpec ) {
|
public static IType createType( IASTDeclSpecifier declSpec ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue