mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 17:21:04 +01:00
Add the used name to the NameUseBeforeDecl diagnostic (#4901)
Part of #4622.
This commit is contained in:
@@ -177,8 +177,8 @@ auto DeclNameStack::AddNameOrDiagnose(NameContext name_context,
|
||||
SemIR::InstId target_id,
|
||||
SemIR::AccessKind access_kind) -> void {
|
||||
if (name_context.state == DeclNameStack::NameContext::State::Poisoned) {
|
||||
DiagnosePoisonedName(*context_, name_context.poisoning_loc_id,
|
||||
name_context.loc_id);
|
||||
DiagnosePoisonedName(*context_, name_context.name_id_for_new_inst(),
|
||||
name_context.poisoning_loc_id, name_context.loc_id);
|
||||
} else if (auto id = name_context.prev_inst_id(); id.has_value()) {
|
||||
DiagnoseDuplicateName(*context_, name_context.loc_id, id);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user