mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
Bug using #foo arguments with $defined #2173
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
- Check pointer/slice/etc on `[out]` and `&` params. #2156.
|
||||
- Compiler didn't check foreach over flexible array member, and folding a flexible array member was allowed #2164.
|
||||
- Too strict project view #2163.
|
||||
- Bug using `#foo` arguments with `$defined` #2173
|
||||
|
||||
### Stdlib changes
|
||||
- Added `String.quick_ztr` and `String.is_zstr`
|
||||
|
||||
@@ -9661,10 +9661,10 @@ static inline bool sema_expr_analyse_ct_defined(SemaContext *context, Expr *expr
|
||||
{
|
||||
case EXPR_OTHER_CONTEXT:
|
||||
active_context->call_env.in_no_eval = in_no_eval;
|
||||
active_context = expr->expr_other_context.context;
|
||||
active_context = main_expr->expr_other_context.context;
|
||||
in_no_eval = active_context->call_env.in_no_eval;
|
||||
active_context->call_env.in_no_eval = true;
|
||||
main_expr = expr->expr_other_context.inner;
|
||||
main_expr = main_expr->expr_other_context.inner;
|
||||
goto RETRY;
|
||||
case EXPR_ACCESS_UNRESOLVED:
|
||||
if (!sema_expr_analyse_access(active_context, main_expr, &failed, CHECK_VALUE, false))
|
||||
|
||||
10
test/test_suite/compile_time_introspection/defined_hash.c3
Normal file
10
test/test_suite/compile_time_introspection/defined_hash.c3
Normal file
@@ -0,0 +1,10 @@
|
||||
macro @test(#a)
|
||||
{
|
||||
$defined(#a);
|
||||
}
|
||||
|
||||
fn int main()
|
||||
{
|
||||
@test(0);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user