mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 21:02:39 +00:00
Add the used name to the NameUseBeforeDecl diagnostic (#4901)
Part of #4622.
This commit is contained in:
1 parent
d65f0d959d
commit
4a93b6667e
11 files changed
+35
-33
No files matched your search
@@ -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