diff --git a/compiler/src/dmd/errors.d b/compiler/src/dmd/errors.d index 5ff9a05ff868..6c1584998772 100644 --- a/compiler/src/dmd/errors.d +++ b/compiler/src/dmd/errors.d @@ -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; diff --git a/compiler/test/compilable/deprecationlimit.d b/compiler/test/compilable/deprecationlimit.d index dcdc9e118ca5..8ee7ab650fbf 100644 --- a/compiler/test/compilable/deprecationlimit.d +++ b/compiler/test/compilable/deprecationlimit.d @@ -18,5 +18,5 @@ void main() f(); f(); f(); - f(); + static assert("1"); // also surpress deprecationSupplemental }