diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-12-05 17:11:12 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-12-09 00:58:58 +0100 |
commit | 0fb57034770aa20adced4d176f34ca611c2945bf (patch) | |
tree | 1f5735c8b4f25aa4a290e5ae8124713c24f98359 /libphobos/src/std/uni | |
parent | c15aa46cca0649b68613d3292cf71c7cc57ef78f (diff) | |
download | gcc-0fb57034770aa20adced4d176f34ca611c2945bf.zip gcc-0fb57034770aa20adced4d176f34ca611c2945bf.tar.gz gcc-0fb57034770aa20adced4d176f34ca611c2945bf.tar.bz2 |
d: Merge upstream dmd 568496d5b, druntime 178c44ff, phobos 574bf883b.
D front-end changes:
- Import dmd v2.098.0
- New ImportC module for compiling preprocessed C11 code into D.
- New -ftransition=in switch.
- Improved handling of new 'noreturn' type.
Druntime changes:
- Import druntime v2.098.0
- Fix broken import in core.sys.linux.perf_event module (PR103558).
Phobos changes:
- Import phobos v2.098.0
- All sources are now compiled with -fpreview=fieldwise.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd 568496d5b.
* Make-lang.in (D_FRONTEND_OBJS): Add d/common-file.o,
d/common-outbuffer.o, d/common-string.o, d/file_manager.o,
d/importc.o. Remove d/root-outbuffer.o.
(d/common-%.o): New recipe.
* d-builtins.cc (build_frontend_type): Update for new front-end
interface.
(d_build_d_type_nodes): Set noreturn_type_node.
* d-codegen.cc (d_build_call): Don't call function if one of the
arguments is type 'noreturn'.
(build_vthis_function): Propagate TYPE_QUAL_VOLATILE from original
function type.
* d-frontend.cc (eval_builtin): Update signature.
(getTypeInfoType): Likewise.
(toObjFile): New function.
* d-gimplify.cc (d_gimplify_call_expr): Always evaluate arguments from
left to right.
* d-lang.cc (d_handle_option): Handle OPT_ftransition_in.
(d_parse_file): Don't generate D main if it is declared in user code.
* d-tree.h (CALL_EXPR_ARGS_ORDERED): Remove.
(enum d_tree_index): Add DTI_BOTTOM_TYPE.
(noreturn_type_node): New.
* decl.cc (apply_pragma_crt): Remove.
(DeclVisitor::visit): Update for new front-end interface.
(DeclVisitor::visit (PragmaDeclaration *)): Don't handle
crt_constructor and crt_destructor pragmas.
(DeclVisitor::visit (VarDeclaration *)): Don't generate declarations
of type 'noreturn'.
(DeclVisitor::visit (FuncDeclaration *)): Stop adding parameters when
'noreturn' type has been encountered.
(get_symbol_decl): Set DECL_STATIC_CONSTRUCTOR and
DECL_STATIC_DESTRUCTOR on decl node if requested.
(aggregate_initializer_decl): Update for new front-end interface.
* expr.cc (ExprVisitor::visit (CallExp *)): Always use the 'this'
object as the result of calling any constructor function.
(ExprVisitor::visit): Update for new front-end interface.
* gdc.texi (Runtime Options): Document -fmain and -ftransition=in.
* lang.opt (ftransition=in): New option.
* modules.cc (get_internal_fn): Update for new front-end interface.
* types.cc (TypeVisitor::visit): Likewise.
(TypeVisitor::visit (TypeNoreturn *)): Return noreturn_type_node.
(TypeVisitor::visit (TypeFunction *)): Stop adding parameters when
'notreturn' type has been encountered. Qualify function types that
return 'noreturn' as TYPE_QUAL_VOLATILE.
libphobos/ChangeLog:
PR d/103558
* libdruntime/MERGE: Merge upstream druntime 178c44ff.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES_LINUX): Add
core/sys/linux/syscalls.d.
(DRUNTIME_DSOURCES_OPENBSD): Add core/sys/openbsd/pthread_np.d.
* libdruntime/Makefile.in: Regenerate.
* src/MERGE: Merge upstream phobos 574bf883b.
* src/Makefile.am (D_EXTRA_DFLAGS): Add -fpreview=fieldwise.
* src/Makefile.in: Regenerate.
* testsuite/libphobos.exceptions/assert_fail.d: Update test.
* testsuite/libphobos.betterc/test22336.d: New test.
Diffstat (limited to 'libphobos/src/std/uni')
-rw-r--r-- | libphobos/src/std/uni/package.d | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libphobos/src/std/uni/package.d b/libphobos/src/std/uni/package.d index 318bcb3..45b7207c 100644 --- a/libphobos/src/std/uni/package.d +++ b/libphobos/src/std/uni/package.d @@ -1528,7 +1528,7 @@ if (is(Unqual!T == T)) return SliceOverIndexed!T(a, b, x); } -@system unittest +@safe unittest { int[] idxArray = [2, 3, 5, 8, 13]; auto sliced = sliceOverIndexed(0, idxArray.length, &idxArray); @@ -3116,7 +3116,7 @@ private: CowArray!SP data; } -pure @system unittest +pure @safe unittest { import std.conv : to; assert(unicode.ASCII.to!string() == "[0..128)"); @@ -5410,7 +5410,7 @@ pure @safe unittest } // cover decode fail cases of Matcher -pure @system unittest +pure @safe unittest { import std.algorithm.iteration : map; import std.exception : collectException; @@ -5427,7 +5427,7 @@ pure @system unittest auto s = msg; size_t idx = 0; utf8.test(s); - }()), format("%( %2x %)", cast(ubyte[]) msg)); + }()), format("%( %2x %)", cast(immutable(ubyte)[]) msg)); } //decode failure cases UTF-16 alias fails16 = AliasSeq!([0xD811], [0xDC02]); @@ -7150,7 +7150,7 @@ if (isInputRange!Input && is(immutable ElementType!Input == immutable dchar)) return genericDecodeGrapheme!true(inp); } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; @@ -7233,7 +7233,7 @@ if (isInputRange!Range && is(immutable ElementType!Range == immutable dchar)) // For testing non-forward-range input ranges version (StdUnittest) -private static struct InputRangeString +private static @safe struct InputRangeString { private string s; @@ -7242,7 +7242,7 @@ private static struct InputRangeString void popFront() { s.popFront(); } } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.array : array; @@ -7366,7 +7366,7 @@ if (isInputRange!Range && is(immutable ElementType!Range == immutable dchar)) assert(reverse == "le\u0308on"); // lëon } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.range.primitives : walkLength; @@ -7523,7 +7523,7 @@ public: } /// - @system unittest + @safe unittest { import std.algorithm.comparison : equal; auto g = Grapheme("A"); @@ -7650,7 +7650,7 @@ private: static assert(Grapheme.sizeof == size_t.sizeof*4); -@system pure /*nothrow @nogc*/ unittest // TODO: string .front is GC and throw +@safe pure /*nothrow @nogc*/ unittest // TODO: string .front is GC and throw { import std.algorithm.comparison : equal; Grapheme[3] data = [Grapheme("Ю"), Grapheme("У"), Grapheme("З")]; @@ -7658,7 +7658,7 @@ static assert(Grapheme.sizeof == size_t.sizeof*4); } /// -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; @@ -7704,7 +7704,7 @@ static assert(Grapheme.sizeof == size_t.sizeof*4); assert(!g.valid); } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; @@ -8205,7 +8205,7 @@ package(std) auto simpleCaseFoldings(dchar ch) @safe return Range(start, entry.size); } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.algorithm.searching : canFind; @@ -8356,7 +8356,7 @@ public Grapheme decompose(UnicodeDecomposition decompType=Canonical)(dchar ch) @ } /// -@system unittest +@safe unittest { import std.algorithm.comparison : equal; @@ -8464,7 +8464,7 @@ Grapheme decomposeHangul(dchar ch) @safe } /// -@system unittest +@safe unittest { import std.algorithm.comparison : equal; assert(decomposeHangul('\uD4DB')[].equal("\u1111\u1171\u11B6")); @@ -8504,7 +8504,7 @@ dchar composeJamo(dchar lead, dchar vowel, dchar trailing=dchar.init) pure nothr assert(composeJamo('A', '\u1171') == dchar.init); } -@system unittest +@safe unittest { import std.algorithm.comparison : equal; import std.conv : text; @@ -10105,7 +10105,7 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i assert(s2 !is s1); } -@system unittest +@safe unittest { static void doTest(C)(const(C)[] s, const(C)[] trueUp, const(C)[] trueLow) { @@ -10118,9 +10118,9 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i assert(low == trueLow, format(diff, low, trueLow)); assert(up == trueUp, format(diff, up, trueUp)); assert(lowInp == trueLow, - format(diff, cast(ubyte[]) s, cast(ubyte[]) lowInp, cast(ubyte[]) trueLow)); + format(diff, cast(const(ubyte)[]) s, cast(const(ubyte)[]) lowInp, cast(const(ubyte)[]) trueLow)); assert(upInp == trueUp, - format(diff, cast(ubyte[]) s, cast(ubyte[]) upInp, cast(ubyte[]) trueUp)); + format(diff, cast(const(ubyte)[]) s, cast(const(ubyte)[]) upInp, cast(const(ubyte)[]) trueUp)); } static foreach (S; AliasSeq!(dstring, wstring, string)) {{ |