mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecate $varef.
This commit is contained in:
@@ -9158,6 +9158,7 @@ static inline bool sema_expr_analyse_ct_arg(SemaContext *context, Type *infer_ty
|
||||
}
|
||||
case TOKEN_CT_VAREF:
|
||||
{
|
||||
SEMA_DEPRECATED(expr, "'$varef' is deprecated together with '&' arguments.");
|
||||
// A normal argument, this means we only evaluate it once.
|
||||
unsigned index = 0;
|
||||
ASSIGN_EXPR_OR_RET(Expr *arg_expr, sema_expr_analyse_ct_arg_index(context, exprptr(expr->ct_arg_expr.arg), &index), false);
|
||||
|
||||
@@ -34,9 +34,9 @@ macro foo3(...)
|
||||
|
||||
macro @foo4(...)
|
||||
{
|
||||
$typeof(*$varef[0]) a = *$varef[0];
|
||||
*$varef[0] = *$varef[1];
|
||||
*$varef[1] = a;
|
||||
$typeof($vaexpr[0]) a = $vaexpr[0];
|
||||
$vaexpr[0] = $vaexpr[1];
|
||||
$vaexpr[1] = a;
|
||||
}
|
||||
fn int ping(int val)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user