mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
- Lambdas on the top level were not exported by default. #2428
|
||||
- `has_tagof` on tagged lambdas returns false #2432
|
||||
- Properly add "inlined at" for generic instantiation errors #2382.
|
||||
- Inlining a const as an lvalue would take the wrong path and corrupt the expression node.
|
||||
|
||||
### Stdlib changes
|
||||
- Add `==` to `Pair`, `Triple` and TzDateTime. Add print to `Pair` and `Triple`.
|
||||
|
||||
@@ -11315,7 +11315,7 @@ RETRY:
|
||||
goto IDENT_CHECK;
|
||||
case EXPR_UNRESOLVED_IDENTIFIER:
|
||||
if (!sema_analyse_expr_dispatch(context, expr, CHECK_VALUE)) return false;
|
||||
FALLTHROUGH;
|
||||
goto RETRY;
|
||||
case EXPR_IDENTIFIER:
|
||||
IDENT_CHECK:;
|
||||
{
|
||||
|
||||
21
test/test_suite/macros/hash_ident_folding.c3
Normal file
21
test/test_suite/macros/hash_ident_folding.c3
Normal file
@@ -0,0 +1,21 @@
|
||||
module testi;
|
||||
|
||||
macro @foo(#x)
|
||||
{
|
||||
#x *= 2; // #error: You cannot assign to a constant expression
|
||||
}
|
||||
|
||||
attrdef @On_Start(x) = @tag("on_start", @foo(x));
|
||||
|
||||
fn void some() @On_Start(fn void(int a) { ; })
|
||||
{
|
||||
}
|
||||
|
||||
fn int main() => main2();
|
||||
|
||||
macro main2()
|
||||
{
|
||||
some.tagof("on_start")(1);
|
||||
some();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user