mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Function pointers are now compile time constants.
const enum cannot be set to function pointer unless it's a lambda #2282.
This commit is contained in:
@@ -1675,7 +1675,7 @@ bool sema_analyse_const_enum_constant_val(SemaContext *context, Decl *decl)
|
||||
{
|
||||
Expr *value = decl->enum_constant.value;
|
||||
if (!sema_analyse_inferred_expr(context, decl->type, value)) return decl_poison(decl);
|
||||
if (!sema_cast_const(value))
|
||||
if (!expr_is_runtime_const(value))
|
||||
{
|
||||
SEMA_ERROR(value, "Expected an constant enum value.");
|
||||
return decl_poison(decl);
|
||||
|
||||
Reference in New Issue
Block a user