From d4b7f5e52a33f2d15aafca7f1b040f3f2821fd0c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 8 Oct 2026 01:29:37 +0200 Subject: Move record constructor type into the braces --- gcc/gcc/elna-generic.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/gcc/elna-generic.cc b/gcc/gcc/elna-generic.cc index 77ff61f..bb93270 100644 --- a/gcc/gcc/elna-generic.cc +++ b/gcc/gcc/elna-generic.cc @@ -248,14 +248,9 @@ namespace elna::gcc void generic_visitor::visit(boot::record_constructor_expression *expression) { - tree type_decl = this->symbols->lookup(expression->type_name.name()); + tree record_type = get_inner_alias(expression->type_decoration, this->symbols); + gcc_assert(TREE_CODE(record_type) == RECORD_TYPE); - if (type_decl == NULL_TREE) - { - this->current_expression = error_mark_node; - return; - } - tree record_type = TREE_TYPE(type_decl); vec *tree_arguments = nullptr; for (const boot::field_initializer& initializer : expression->field_initializers) @@ -271,12 +266,8 @@ namespace elna::gcc void generic_visitor::visit(boot::array_constructor_expression *expression) { tree array_type = get_inner_alias(expression->type_decoration, this->symbols); + gcc_assert(TREE_CODE(array_type) == ARRAY_TYPE); - if (TREE_CODE(array_type) != ARRAY_TYPE) - { - this->current_expression = error_mark_node; - return; - } tree domain = TYPE_DOMAIN(array_type); tree index = TYPE_MIN_VALUE(domain); vec *tree_arguments = nullptr; -- cgit v1.2.3