From 1d08dcf1f9c56d1b59edc9cb0c4f05cb8cef28eb Mon Sep 17 00:00:00 2001 From: Dennis Date: Tue, 13 Aug 2024 23:23:09 +0200 Subject: [PATCH 1/3] Also make deprecationSupplemental adhere to error limit (dlang/dmd!16779) Co-authored-by: Dennis Korpel --- dmd/errors.d | 7 +++++-- tests/dmd/compilable/deprecationlimit.d | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dmd/errors.d b/dmd/errors.d index c7f647de9be..3b812482071 100644 --- a/dmd/errors.d +++ b/dmd/errors.d @@ -567,8 +567,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/tests/dmd/compilable/deprecationlimit.d b/tests/dmd/compilable/deprecationlimit.d index dcdc9e118ca..8ee7ab650fb 100644 --- a/tests/dmd/compilable/deprecationlimit.d +++ b/tests/dmd/compilable/deprecationlimit.d @@ -18,5 +18,5 @@ void main() f(); f(); f(); - f(); + static assert("1"); // also surpress deprecationSupplemental } From cf38499e460ecca39724f327f31744fba4433cfa Mon Sep 17 00:00:00 2001 From: Dennis Korpel Date: Tue, 13 Aug 2024 22:29:43 +0200 Subject: [PATCH 2/3] Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument --- dmd/dtemplate.d | 6 ++++++ tests/dmd/compilable/compile1.d | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/dmd/dtemplate.d b/dmd/dtemplate.d index 0881acf18d7..19de63db669 100644 --- a/dmd/dtemplate.d +++ b/dmd/dtemplate.d @@ -4556,9 +4556,15 @@ extern (C++) class TemplateInstance : ScopeDsymbol // The arguments are not treated as part of a default argument, // because they are evaluated at compile time. + const inCondition = !!(sc.flags & SCOPE.condition); + // For master branch: const inCondition = sc.condition; sc = sc.push(); sc.inDefaultArg = false; + // https://issues.dlang.org/show_bug.cgi?id=24699 + sc.flags |= SCOPE.condition * inCondition; + // For master branch: sc.condition = inCondition; + for (size_t j = 0; j < tiargs.length; j++) { RootObject o = (*tiargs)[j]; diff --git a/tests/dmd/compilable/compile1.d b/tests/dmd/compilable/compile1.d index 4678eb53386..676108f68cf 100644 --- a/tests/dmd/compilable/compile1.d +++ b/tests/dmd/compilable/compile1.d @@ -623,6 +623,11 @@ static assert (__traits(compiles, false && error) == false); int f11042a3()() if (__traits(compiles, true || error) == false) { return 0; } enum x11042a3 = f11042a3(); int f11042b3()() if (__traits(compiles, false && error) == false) { return 0; } enum x11042b3 = f11042b3(); +// https://issues.dlang.org/show_bug.cgi?id=24699 +enum T24699(bool cond) = cond; +enum b24699a = T24699!(true || error); +enum b24699b = T24699!(false && error); + /***************************************************/ // https://issues.dlang.org/show_bug.cgi?id=11554 From 68db4b92f5109e9e5979d31c5f1a4a8bf31a2f96 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Tue, 20 Aug 2024 20:21:57 +0200 Subject: [PATCH 3/3] Bump Phobos --- CHANGELOG.md | 2 +- runtime/phobos | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b05c664ce11..4ca2e702508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # LDC master #### Big news -- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707) +- Frontend, druntime and Phobos are at version [2.110.0](https://dlang.org/changelog/2.110.0.html). (#4707, #4737) - LLVM for prebuilt packages bumped to v18.1.8 (incl. macOS arm64). (#4712) - Android: NDK for prebuilt package bumped from r26d to r27. (#4711) - ldc2.conf: %%ldcconfigpath%% placeholder added - specifies the directory where current configuration file is located. (#4717) diff --git a/runtime/phobos b/runtime/phobos index 11bf089f6cd..788d4b0fed3 160000 --- a/runtime/phobos +++ b/runtime/phobos @@ -1 +1 @@ -Subproject commit 11bf089f6cdbc8cca375569e6e638ea88fcfd5ed +Subproject commit 788d4b0fed3c7ba46654a5548d1e7401586471c3