Unable to access fields of a const inline enum with an aggregate underlying type. #2802

This commit is contained in:
Christoffer Lerno
2026-01-21 13:22:46 +01:00
parent a126a25d66
commit cef48482f1
3 changed files with 45 additions and 0 deletions

View File

@@ -251,6 +251,14 @@ Expr *sema_enter_inline_member(Expr *parent, CanonicalType *type)
expr->type = type;
break;
}
case TYPE_CONST_ENUM:
{
Decl *decl = type->decl;
if (!decl->is_substruct) return NULL;
expr = expr_copy(parent);
expr->type = decl->enums.type_info->type;
return expr;
}
case TYPE_ENUM:
{
Decl *decl = type->decl;