Skip to content

Commit

Permalink
Also make deprecationSupplemental adhere to error limit (dlang#16779)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Korpel <[email protected]>
  • Loading branch information
2 people authored and thewilsonator committed Oct 7, 2024
1 parent 403dbb1 commit 6893869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions compiler/src/dmd/errors.d
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,11 @@ extern (C++) void verrorReportSupplemental(const ref Loc loc, const(char)* forma
goto case ErrorKind.error;
else if (global.params.useDeprecated == DiagnosticReporting.inform && !global.gag)
{
info.headerColor = Classification.deprecation;
verrorPrint(format, ap, info);
if (global.params.v.errorLimit == 0 || global.deprecations <= global.params.v.errorLimit)
{
info.headerColor = Classification.deprecation;
verrorPrint(format, ap, info);
}
}
break;

Expand Down
2 changes: 1 addition & 1 deletion compiler/test/compilable/deprecationlimit.d
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ void main()
f();
f();
f();
f();
static assert("1"); // also surpress deprecationSupplemental
}

0 comments on commit 6893869

Please sign in to comment.