mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Prevent ct_eval from returning an rvalue.
This commit is contained in:
@@ -6242,11 +6242,10 @@ static inline bool sema_expr_analyse_ct_eval(SemaContext *context, Expr *expr)
|
|||||||
case TOKEN_IDENT:
|
case TOKEN_IDENT:
|
||||||
case TOKEN_CONST_IDENT:
|
case TOKEN_CONST_IDENT:
|
||||||
expr->expr_kind = EXPR_IDENTIFIER;
|
expr->expr_kind = EXPR_IDENTIFIER;
|
||||||
expr->resolve_status = RESOLVE_NOT_DONE;
|
|
||||||
expr->identifier_expr.ident = ident;
|
expr->identifier_expr.ident = ident;
|
||||||
expr->identifier_expr.path = path;
|
expr->identifier_expr.path = path;
|
||||||
expr->identifier_expr.is_const = type == TOKEN_CONST_IDENT;
|
expr->identifier_expr.is_const = type == TOKEN_CONST_IDENT;
|
||||||
return sema_analyse_expr(context, expr);
|
return sema_analyse_expr_dispatch(context, expr);
|
||||||
default:
|
default:
|
||||||
SEMA_ERROR(inner, "Only function, variable and constant names may be resolved with $eval.");
|
SEMA_ERROR(inner, "Only function, variable and constant names may be resolved with $eval.");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define COMPILER_VERSION "0.3.66"
|
#define COMPILER_VERSION "0.3.67"
|
||||||
5
test/test_suite/compile_time/ct_eval_sym.c3
Normal file
5
test/test_suite/compile_time/ct_eval_sym.c3
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fn int test()
|
||||||
|
{
|
||||||
|
void* x = (void*)&$eval($$FUNC);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
5
test/test_suite2/compile_time/ct_eval_sym.c3
Normal file
5
test/test_suite2/compile_time/ct_eval_sym.c3
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
fn int test()
|
||||||
|
{
|
||||||
|
void* x = (void*)&$eval($$FUNC);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user