mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user