1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 23:55:26 +02:00

Bug 545756 - Fix aggregate init from string literal

Fix nested type for typedefs

Change-Id: Ie8ff31c9db9f3112487760640885066ea8cb0fd3
Signed-off-by: Hannes Vogt <hannes@havogt.de>
This commit is contained in:
Hannes Vogt 2019-04-29 21:56:49 +02:00 committed by Nathan Ridge
parent cde06e5354
commit 571b21b2f5
2 changed files with 4 additions and 2 deletions

View file

@ -13044,8 +13044,9 @@ public class AST2CPPTests extends AST2CPPTestBase {
bh.assertImplicitName("b{v};", 1, IProblemBinding.class);
}
// using my_char = char;
// struct type {
// char data[2];
// my_char data[2];
// };
//
// type foo{"s"};

View file

@ -215,7 +215,8 @@ class AggregateInitialization {
*/
private static ICPPBasicType getBasicTypeFromArray(IType type) {
if (type instanceof IArrayType) {
IType nested = SemanticUtil.getNestedType(((IArrayType) type).getType(), SemanticUtil.ALLCVQ);
IType nested = SemanticUtil.getNestedType(((IArrayType) type).getType(),
SemanticUtil.ALLCVQ | SemanticUtil.TDEF);
if (nested instanceof ICPPBasicType) {
return (ICPPBasicType) nested;
}