Skip to content

Commit

Permalink
Fix bugzilla issue 24812 - Incorrect highlighting when diagnosing an …
Browse files Browse the repository at this point in the history
…empty enum declaration (dlang/dmd!17004)
  • Loading branch information
thewilsonator authored Oct 14, 2024
1 parent 602caab commit 24b56d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dmd/enumsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void enumSemantic(Scope* sc, EnumDeclaration ed)

if (ed.members.length == 0)
{
.error(ed.loc, "%s `%s enum `%s` must have at least one member", ed.kind, ed.toPrettyChars, ed.toChars());
.error(ed.loc, "%s `%s` enum `%s` must have at least one member", ed.kind, ed.toPrettyChars, ed.toChars());
ed.errors = true;
ed.semanticRun = PASS.semanticdone;
return;
Expand Down
7 changes: 7 additions & 0 deletions tests/dmd/fail_compilation/diag24812.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/diag24812.d(7): Error: enum `diag24812.Foo` enum `Foo` must have at least one member
---
*/
enum Foo {}

0 comments on commit 24b56d8

Please sign in to comment.