- $$LINE would sometimes incorrectly be constant.

This commit is contained in:
Christoffer Lerno
2025-12-16 13:30:43 +01:00
parent 759389066f
commit 651735f9a0
2 changed files with 3 additions and 0 deletions

View File

@@ -20,6 +20,7 @@
- `$defined(foo())` now correctly errors if `foo()` would require a path.
- `@if($defined((char*){}.foo()))` does not error if `foo` is missing.
- Hard limit of 127 characters for identifiers.
- `$$LINE` would sometimes incorrectly be constant.
### Stdlib changes
- Add `ThreadPool` join function to wait for all threads to finish in the pool without destroying the threads.

View File

@@ -1691,11 +1691,13 @@ INLINE bool sema_set_default_argument(SemaContext *context, CalledDecl *callee,
SemaContext *new_context = context_transform_for_eval(context, &default_context, param->unit);
bool success;
SCOPE_START
uint32_t line = new_context->original_inline_line;
new_context->original_inline_line = context->original_inline_line ? context->original_inline_line
: call->span.row;
new_context->original_module = context->original_module;
success = sema_analyse_parameter(new_context, arg, param, callee->definition, optional, no_match_ref,
callee->macro, false);
new_context->original_inline_line = line;
SCOPE_END;
sema_context_destroy(&default_context);
if (no_match_ref && *no_match_ref) return true;