From fd43568cc54e17c8b4a845677872c6282bc6dbb7 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 15 Dec 2021 19:47:02 +0100 Subject: d: Merge upstream dmd 93108bb9e, druntime 6364e010, phobos 575b67a9b. D front-end changes: - Import dmd v2.098.1-beta.1. - Default extern(C++) compatibility to C++17. Druntime changes: - Import druntime v2.098.1-beta.1. - Fix definition of stat_t on MIPS64 (PR103604) Phobos changes: - Import phobos v2.098.1-beta.1. gcc/d/ChangeLog: * d-lang.cc (d_init_options): Set default -fextern-std= to C++17. * dmd/MERGE: Merge upstream dmd 93108bb9e. * gdc.texi (Runtime Options): Document the default for -fextern-std=. libphobos/ChangeLog: PR d/103604 * configure: Regenerate. * configure.ac (libtool_VERSION): Update to 3:0:0. * libdruntime/MERGE: Merge upstream druntime 6364e010. * src/MERGE: Merge upstream phobos 575b67a9b. * testsuite/libphobos.traits/all_satisfy.d: New test. * testsuite/libphobos.traits/traits.exp: New test. --- libphobos/testsuite/libphobos.traits/all_satisfy.d | 24 +++++++++++++++++++ libphobos/testsuite/libphobos.traits/traits.exp | 27 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 libphobos/testsuite/libphobos.traits/all_satisfy.d create mode 100644 libphobos/testsuite/libphobos.traits/traits.exp (limited to 'libphobos/testsuite/libphobos.traits') diff --git a/libphobos/testsuite/libphobos.traits/all_satisfy.d b/libphobos/testsuite/libphobos.traits/all_satisfy.d new file mode 100644 index 0000000..2c008ce --- /dev/null +++ b/libphobos/testsuite/libphobos.traits/all_satisfy.d @@ -0,0 +1,24 @@ +// https://issues.dlang.org/show_bug.cgi?id=22210 + +import core.internal.traits : allSatisfy; + +enum isHashable(T) = __traits(compiles, + () { T.init; } +); + +class A +{ + static if (isHashable!B) {} +} + +class B +{ + static if (isHashable!C) {} +} + +class C +{ + static if (allSatisfy!(isHashable, int, B)) {} +} + +void main() {} diff --git a/libphobos/testsuite/libphobos.traits/traits.exp b/libphobos/testsuite/libphobos.traits/traits.exp new file mode 100644 index 0000000..cb78538 --- /dev/null +++ b/libphobos/testsuite/libphobos.traits/traits.exp @@ -0,0 +1,27 @@ +# Copyright (C) 2021 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Initialize dg. +dg-init + +# Gather a list of all tests. +set tests [lsort [find $srcdir/$subdir *.d]] + +# Main loop. +dg-runtest $tests "" $DEFAULT_DFLAGS + +# All done. +dg-finish -- cgit v1.1