mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 22:02:40 +00: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:
1 parent
a8aca3ce71
commit
c67920e631
14 files changed
+246
-120
No files matched your search
@@ -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