+ if (anonymous_entity != NULL) {
+ if (is_type_compound(type)) {
+ assert(anonymous_entity->compound.alias == NULL);
+ assert(anonymous_entity->kind == ENTITY_STRUCT ||
+ anonymous_entity->kind == ENTITY_UNION);
+ anonymous_entity->compound.alias = entity;
+ anonymous_entity = NULL;
+ } else if (is_type_enum(type)) {
+ assert(anonymous_entity->enume.alias == NULL);
+ assert(anonymous_entity->kind == ENTITY_ENUM);
+ anonymous_entity->enume.alias = entity;
+ anonymous_entity = NULL;
+ }
+ }
+ } else {
+ if (create_compound_member) {
+ entity = allocate_entity_zero(ENTITY_COMPOUND_MEMBER);
+ } else if (is_type_function(skip_typeref(type))) {
+ entity = allocate_entity_zero(ENTITY_FUNCTION);
+
+ entity->function.is_inline = specifiers->is_inline;
+ entity->function.parameters = env.parameters;
+ } else {
+ entity = allocate_entity_zero(ENTITY_VARIABLE);
+
+ entity->variable.get_property_sym = specifiers->get_property_sym;
+ entity->variable.put_property_sym = specifiers->put_property_sym;
+ if (specifiers->alignment != 0) {
+ /* TODO: add checks here */
+ entity->variable.alignment = specifiers->alignment;
+ }
+
+ if (warning.other && specifiers->is_inline && is_type_valid(type)) {
+ warningf(&env.source_position,
+ "variable '%Y' declared 'inline'\n", env.symbol);
+ }
+ }
+
+ entity->base.source_position = env.source_position;
+ entity->base.symbol = env.symbol;
+ entity->base.namespc = NAMESPACE_NORMAL;
+ entity->declaration.type = type;
+ entity->declaration.modifiers = env.modifiers;
+ entity->declaration.deprecated_string = specifiers->deprecated_string;
+
+ storage_class_t storage_class = specifiers->storage_class;
+ entity->declaration.declared_storage_class = storage_class;
+
+ if (storage_class == STORAGE_CLASS_NONE
+ && current_scope != file_scope) {
+ storage_class = STORAGE_CLASS_AUTO;
+ }
+ entity->declaration.storage_class = storage_class;