From a0dd75c355be6621e3c83d685d562a7af78986c1 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Tue, 27 Apr 2021 15:09:38 +0200 Subject: [PATCH] Merge upstream stable (dlang/dmd@37b74d7219) --- CMakeLists.txt | 2 +- dmd/dcast.d | 6 ++++++ dmd/dmangle.d | 2 +- dmd/dsymbol.d | 2 +- dmd/dsymbolsem.d | 2 +- dmd/dtemplate.d | 2 ++ dmd/traits.d | 4 ++-- runtime/druntime | 2 +- runtime/phobos | 2 +- tests/d2/dmd-testsuite | 2 +- 10 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63712e335b8..8bd42b191c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,7 +113,7 @@ set(LDC_VERSION "1.26.0") # May be overridden by git hash tag set(DMDFE_MAJOR_VERSION 2) set(DMDFE_MINOR_VERSION 0) set(DMDFE_PATCH_VERSION 96) -set(DMDFE_FIX_LEVEL 0) +set(DMDFE_FIX_LEVEL 1) set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION}) if(DEFINED DMDFE_FIX_LEVEL) diff --git a/dmd/dcast.d b/dmd/dcast.d index ffc41ef090d..9bd94cf387f 100644 --- a/dmd/dcast.d +++ b/dmd/dcast.d @@ -1400,7 +1400,13 @@ MATCH implicitConvTo(Expression e, Type t) { typeb = toStaticArrayType(e); if (typeb) + { + // Try: T[] -> T[dim] + // (Slice with compile-time known boundaries to static array) result = typeb.implicitConvTo(t); + if (result > MATCH.convert) + result = MATCH.convert; // match with implicit conversion at most + } return; } diff --git a/dmd/dmangle.d b/dmd/dmangle.d index 32b3c19c924..e8e4e3ca122 100644 --- a/dmd/dmangle.d +++ b/dmd/dmangle.d @@ -654,7 +654,7 @@ public: n /= 10; ++ndigits; } - buf.printf("%u__S%u", ndigits + 4, localNum); + buf.printf("%u__S%u", ndigits + 3, localNum); } } } diff --git a/dmd/dsymbol.d b/dmd/dsymbol.d index 9eb2e8e4a85..834198355c0 100644 --- a/dmd/dsymbol.d +++ b/dmd/dsymbol.d @@ -2206,7 +2206,7 @@ extern (C++) final class AliasAssign : Dsymbol Dsymbol aliassym; /// replace previous RHS of AliasDeclaration with `aliassym` /// only one of type and aliassym can be != null - extern (D) this(const ref Loc loc, Identifier ident, Type type, Dsymbol aliasssym) + extern (D) this(const ref Loc loc, Identifier ident, Type type, Dsymbol aliassym) { super(loc, null); this.ident = ident; diff --git a/dmd/dsymbolsem.d b/dmd/dsymbolsem.d index cdd7a411316..8e33a2838c7 100644 --- a/dmd/dsymbolsem.d +++ b/dmd/dsymbolsem.d @@ -6690,7 +6690,7 @@ void aliasSemantic(AliasDeclaration ds, Scope* sc) // pass to distinguish. // If it is a type, then `.type` is set and getType() will return that // type. If it is a symbol, then `.aliassym` is set and type is `null` - - // toAlias() will return `.aliasssym` + // toAlias() will return `.aliassym` const errors = global.errors; Type oldtype = ds.type; diff --git a/dmd/dtemplate.d b/dmd/dtemplate.d index 5fe07512238..db2d8ec4d76 100644 --- a/dmd/dtemplate.d +++ b/dmd/dtemplate.d @@ -4879,6 +4879,8 @@ MATCH deduceType(RootObject o, Scope* sc, Type tparam, TemplateParameters* param if (Type tsa = toStaticArrayType(e)) { tsa.accept(this); + if (result > MATCH.convert) + result = MATCH.convert; // match with implicit conversion at most return; } } diff --git a/dmd/traits.d b/dmd/traits.d index d1fc34687a4..b43492c4362 100644 --- a/dmd/traits.d +++ b/dmd/traits.d @@ -1450,10 +1450,10 @@ else if (stc & STC.out_) push("out"); - else if (stc & STC.ref_) - push("ref"); else if (stc & STC.in_) push("in"); + else if (stc & STC.ref_) + push("ref"); else if (stc & STC.lazy_) push("lazy"); else if (stc & STC.alias_) diff --git a/runtime/druntime b/runtime/druntime index 453035bdfd9..45e2e56451e 160000 --- a/runtime/druntime +++ b/runtime/druntime @@ -1 +1 @@ -Subproject commit 453035bdfd93e889a80776d48c68fa98673edc6e +Subproject commit 45e2e56451e22dd834bef6ec8f541aa299293e92 diff --git a/runtime/phobos b/runtime/phobos index 0c5e3bec681..b7ec90869b9 160000 --- a/runtime/phobos +++ b/runtime/phobos @@ -1 +1 @@ -Subproject commit 0c5e3bec681df3416c805f9587a3cb18c8bcee6a +Subproject commit b7ec90869b9121cb0970458b2c55e64002a52f8f diff --git a/tests/d2/dmd-testsuite b/tests/d2/dmd-testsuite index ffc138f8fe2..83dbce03134 160000 --- a/tests/d2/dmd-testsuite +++ b/tests/d2/dmd-testsuite @@ -1 +1 @@ -Subproject commit ffc138f8fe247a9126d991dee8e8d0b6b450eebd +Subproject commit 83dbce031345a7048b9bc52525227977d9476d75