Fix tests and error in returning error on function name.

This commit is contained in:
Christoffer Lerno
2026-02-08 22:54:18 +01:00
parent b8ee5a4150
commit 80ad0e02ad
3 changed files with 7 additions and 3 deletions

View File

@@ -954,7 +954,7 @@ static inline bool sema_cast_ident_rvalue(SemaContext *context, Expr *expr)
switch (decl->decl_kind)
{
case DECL_FUNC:
SEMA_ERROR(expr, "A function name cannot be used as a value, did you want to pass it by pointer? If so then you need to add '&', like '&%s'.", decl->span);
SEMA_ERROR(expr, "A function name cannot be used as a value, did you want to pass it by pointer? If so then you need to add '&', like '&%s'.", decl->name);
return expr_poison(expr);
case DECL_MACRO:
SEMA_ERROR(expr, "Expected a macro followed by (...).");