When diagnosing name used before declared, set the location of the usage (#4860)

Done by adding a poisoning location for each poisoned name.
Part of #4622.
This commit is contained in:
Boaz Brickner
2025-02-03 20:01:09 +00:00
committed by GitHub
parent a8aca3ce71
commit c67920e631
14 changed files with 246 additions and 120 deletions
+2 -1
View File
@@ -255,7 +255,8 @@ static auto BuildFunctionDecl(Context& context,
}
if (name_context.state == DeclNameStack::NameContext::State::Poisoned) {
context.DiagnosePoisonedName(function_info.latest_decl_id());
context.DiagnosePoisonedName(name_context.poisoning_loc_id,
function_info.latest_decl_id());
} else {
TryMergeRedecl(context, node_id, name_context.prev_inst_id(), function_decl,
function_info, is_definition);