diff options
| author | gingerBill <bill@gingerbill.org> | 2022-04-26 11:38:32 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-04-26 11:38:32 +0100 |
| commit | 530401e5ee84bd3346b6a3213814a904696019df (patch) | |
| tree | 08cf48e959456d126b785188842ad1a5fb7d78e6 /src/check_type.cpp | |
| parent | a412d34574649cceacea6a171ccd4af6119c7a0f (diff) | |
Fix #1729
Diffstat (limited to 'src/check_type.cpp')
| -rw-r--r-- | src/check_type.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp index 51f472961..c0ae64baa 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -1338,14 +1338,14 @@ ParameterValue handle_parameter_value(CheckerContext *ctx, Type *in_type, Type * } } } - } else if (allow_caller_location && o.mode == Addressing_Context) { + } else if (allow_caller_location && (o.mode == Addressing_Context || are_types_identical(o.type, t_source_code_location))) { param_value.kind = ParameterValue_Value; param_value.ast_value = expr; } else if (o.value.kind != ExactValue_Invalid) { param_value.kind = ParameterValue_Constant; param_value.value = o.value; } else { - error(expr, "Default parameter must be a constant, %d", o.mode); + error(expr, "Default parameter must be a constant"); } } } else { |