mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 356730: Resolution of designated initializers
This commit is contained in:
parent
b91945ccac
commit
c4e19ace4c
2 changed files with 13 additions and 2 deletions
|
@ -464,4 +464,15 @@ public class IndexCBindingResolutionBugs extends IndexBindingResolutionTestBase
|
||||||
getBindingFromASTName("f255", 0);
|
getBindingFromASTName("f255", 0);
|
||||||
getBindingFromASTName("f256", 0);
|
getBindingFromASTName("f256", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// struct B {
|
||||||
|
// float f;
|
||||||
|
// };
|
||||||
|
|
||||||
|
// struct B b = {
|
||||||
|
// .f = 3.1
|
||||||
|
// };
|
||||||
|
public void testDesignatedInitializer_Bug210019() throws Exception {
|
||||||
|
IField f= getBindingFromASTName("f", 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -887,8 +887,8 @@ public class CVisitor extends ASTQueries {
|
||||||
else if (simpleDecl.getDeclSpecifier() instanceof IASTCompositeTypeSpecifier)
|
else if (simpleDecl.getDeclSpecifier() instanceof IASTCompositeTypeSpecifier)
|
||||||
struct = ((IASTCompositeTypeSpecifier) simpleDecl.getDeclSpecifier()).getName().resolveBinding();
|
struct = ((IASTCompositeTypeSpecifier) simpleDecl.getDeclSpecifier()).getName().resolveBinding();
|
||||||
|
|
||||||
if (struct instanceof CStructure) {
|
if (struct instanceof ICompositeType) {
|
||||||
return ((CStructure) struct).findField(((ICASTFieldDesignator) node).getName().toString());
|
return ((ICompositeType) struct).findField(((ICASTFieldDesignator) node).getName().toString());
|
||||||
} else if (struct instanceof ITypeContainer) {
|
} else if (struct instanceof ITypeContainer) {
|
||||||
IType type;
|
IType type;
|
||||||
type = ((ITypeContainer) struct).getType();
|
type = ((ITypeContainer) struct).getType();
|
||||||
|
|
Loading…
Add table
Reference in a new issue