aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/algorithm
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2021-04-02 13:29:22 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2021-04-04 01:26:20 +0200
commit5a0aa603b2452dca48ad86d97d4b918187d259fc (patch)
tree67439099b8129248a45826b5791912b20ff3c3fb /libphobos/src/std/algorithm
parentba0f6902666430e5d065a92b3d5292cba91813d3 (diff)
downloadgcc-5a0aa603b2452dca48ad86d97d4b918187d259fc.zip
gcc-5a0aa603b2452dca48ad86d97d4b918187d259fc.tar.gz
gcc-5a0aa603b2452dca48ad86d97d4b918187d259fc.tar.bz2
d: Merge upstream dmd 3b808e838, druntime 483bc129, phobos f89dc217a
D front-end changes: - Explicit package visibility attribute is now always applied to introducing scopes. - Added `__traits(totype, string)' to convert mangled type string to an existing type. - Printf-like and scanf-like functions are now detected by prefixing them with `pragma(printf)' for printf-like functions or `pragma(scanf)' for scanf-like functions. - Added `__c_wchar_t', `__c_complex_float', `__c_complex_double', and `__c_complex_real' types for interfacing with C and C++. - Template alias parameters can now be instantiated with basic types, such as `int` or `void function()`. - Mixins can now be used as types in the form `mixin(string) var'. - Mixin expressions can take an argument list, same as `pragma(msg)'. - Implement DIP1034, add `typeof(*null)' types to represent `noreturn'. - `pragma(msg)' can print expressions of type `void'. - It is now an error to use private variables selectively imported from other modules. Due to a bug, some imported private members were visible from other modules, violating the specification. - Added new syntax to declare an alias to a function type using the `alias' syntax based on the assignment operator. - Function literals can now return a value by reference. Phobos changes: - Synchronize C bindings with the latest port fixes in upstream druntime. - Added alias for a `noreturn' type in object.d - Make use of the new `pragma(printf)' and `pragma(scanf)' pragmas, fix all code that got flagged as being incorrect. - Fixed code that relied on bugs in the D import package system. Reviewed-on: https://github.com/dlang/dmd/pull/12339 https://github.com/dlang/druntime/pull/3422 https://github.com/dlang/phobos/pull/7932 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 3b808e838. * Make-lang.in (D_FRONTEND_OBJS): Add d/chkformat.o. * d-codegen.cc (build_struct_literal): Handle special enums. * d-convert.cc (convert_expr): Handle noreturn type. (convert_for_condition): Likewise. * d-target.cc (Target::_init): Set type for wchar_t. (TargetCPP::derivedClassOffset): New method. (Target::libraryObjectMonitors): New method. * decl.cc (get_symbol_decl): Set TREE_THIS_VOLATILE for functions of type noreturn. * toir.cc (IRVisitor::visit (ReturnStatement *)): Handle returning noreturn types. * types.cc (TypeVisitor::visit (TypeNoreturn *)): New method. (TypeVisitor::visit (TypeEnum *)): Handle special enums. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 483bc129. * libdruntime/Makefile.am (DRUNTIME_DSOURCES_DARWIN): Add core/sys/darwin/fcntl.d. (DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/unistd.d. (DRUNTIME_DSOURCES_WINDOWS): Add core/sys/windows/stdc/malloc.d. * libdruntime/Makefile.in: Regenerate. * src/MERGE: Merge upstream phobos f89dc217a. * src/Makefile.am (PHOBOS_DSOURCES): Add std/regex/internal/tests2.d. * src/Makefile.in: Regenerate. * testsuite/libphobos.exceptions/chain.d: Fix format arguments. * testsuite/libphobos.exceptions/line_trace.d: Likewise.
Diffstat (limited to 'libphobos/src/std/algorithm')
-rw-r--r--libphobos/src/std/algorithm/iteration.d8
-rw-r--r--libphobos/src/std/algorithm/searching.d4
2 files changed, 6 insertions, 6 deletions
diff --git a/libphobos/src/std/algorithm/iteration.d b/libphobos/src/std/algorithm/iteration.d
index c77792d..19cfb77 100644
--- a/libphobos/src/std/algorithm/iteration.d
+++ b/libphobos/src/std/algorithm/iteration.d
@@ -769,9 +769,9 @@ private struct MapResult(alias fun, Range)
string s1 = "hello world!";
dstring s2 = "日本語";
dstring s3 = "hello world!"d;
- auto ms1 = map!(std.ascii.toUpper)(s1);
- auto ms2 = map!(std.ascii.toUpper)(s2);
- auto ms3 = map!(std.ascii.toUpper)(s3);
+ auto ms1 = map!(toUpper)(s1);
+ auto ms2 = map!(toUpper)(s2);
+ auto ms3 = map!(toUpper)(s3);
static assert(!is(ms1[0])); //narrow strings can't be indexed
assert(ms2[0] == '日');
assert(ms3[0] == 'H');
@@ -4450,7 +4450,7 @@ private struct SplitterResult(alias isTerminator, Range)
["là", "dove", "terminava", "quella", "valle"]
));
assert(equal(
- splitter!(std.uni.isWhite)("là dove terminava quella valle"),
+ splitter!(isWhite)("là dove terminava quella valle"),
["là", "dove", "terminava", "quella", "valle"]
));
assert(equal(splitter!"a=='本'"("日本語"), ["日", "語"]));
diff --git a/libphobos/src/std/algorithm/searching.d b/libphobos/src/std/algorithm/searching.d
index 6468a87..09073f6 100644
--- a/libphobos/src/std/algorithm/searching.d
+++ b/libphobos/src/std/algorithm/searching.d
@@ -959,8 +959,8 @@ if (isInputRange!R &&
import std.ascii : isDigit;
import std.uni : isWhite;
- assert(countUntil!(std.uni.isWhite)("hello world") == 5);
- assert(countUntil!(std.ascii.isDigit)("hello world") == -1);
+ assert(countUntil!(isWhite)("hello world") == 5);
+ assert(countUntil!(isDigit)("hello world") == -1);
assert(countUntil!"a > 20"([0, 7, 12, 22, 9]) == 3);
}