summaryrefslogtreecommitdiff
path: root/libphobos/src
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2022-03-02 18:16:08 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2022-03-02 18:21:38 +0100
commit8977f4bec650bb6975792772245b07b722ee9843 (patch)
tree495444470878e267304174ed409829358ae07740 /libphobos/src
parent12f8dc0b642db5edc702f252af1a5231606b29db (diff)
downloadgcc-8977f4bec650bb6975792772245b07b722ee9843.tar.gz
d: Merge upstream dmd 423f19b41, druntime 100a608c, phobos a1f8c4c07.
D Runtime changes: - Fix stdc.stdio bindings to not depend on druntime (PR104729). - Implement stdc.math for Solaris (PR104735). gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 423f19b41. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 100a608c. * src/MERGE: Merge upstream phobos a1f8c4c07.
Diffstat (limited to 'libphobos/src')
-rw-r--r--libphobos/src/MERGE2
-rw-r--r--libphobos/src/std/datetime/systime.d35
-rw-r--r--libphobos/src/std/sumtype.d41
3 files changed, 21 insertions, 57 deletions
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE
index e15541e181d..5fd357c534a 100644
--- a/libphobos/src/MERGE
+++ b/libphobos/src/MERGE
@@ -1,4 +1,4 @@
-41aaf8c2636df0e2e3ad39933b321d2b4cd231fa
+a1f8c4c0700ce4e256f4130ad7883c6ea3890901
The first line of this file holds the git revision number of the last
merge done from the dlang/phobos repository.
diff --git a/libphobos/src/std/datetime/systime.d b/libphobos/src/std/datetime/systime.d
index 9b2a8443fdd..db325f727e8 100644
--- a/libphobos/src/std/datetime/systime.d
+++ b/libphobos/src/std/datetime/systime.d
@@ -8713,13 +8713,14 @@ public:
/++
Creates a $(LREF SysTime) from a string with the format
- YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds is the time
- zone). Whitespace is stripped from the given string.
+ YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds and TZ
+ is the time zone). Whitespace is stripped from the given string.
- The exact format is exactly as described in `toISOString` except that
- trailing zeroes are permitted - including having fractional seconds with
- all zeroes. However, a decimal point with nothing following it is
- invalid. Also, while $(LREF toISOString) will never generate a string
+ The exact format is exactly as described in $(LREF toISOString) except
+ that trailing zeroes are permitted - including having fractional seconds
+ with all zeroes. The time zone and fractional seconds are optional,
+ however, a decimal point with nothing following it is invalid.
+ Also, while $(LREF toISOString) will never generate a string
with more than 7 digits in the fractional seconds (because that's the
limit with hecto-nanosecond precision), it will allow more than 7 digits
in order to read strings from other sources that have higher precision
@@ -9024,13 +9025,14 @@ public:
/++
Creates a $(LREF SysTime) from a string with the format
- YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the
- time zone). Whitespace is stripped from the given string.
+ YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ
+ is the time zone). Whitespace is stripped from the given string.
- The exact format is exactly as described in `toISOExtString`
+ The exact format is exactly as described in $(LREF toISOExtString)
except that trailing zeroes are permitted - including having fractional
- seconds with all zeroes. However, a decimal point with nothing following
- it is invalid. Also, while $(LREF toISOExtString) will never generate a
+ seconds with all zeroes. The time zone and fractional seconds are
+ optional, however, a decimal point with nothing following it is invalid.
+ Also, while $(LREF toISOExtString) will never generate a
string with more than 7 digits in the fractional seconds (because that's
the limit with hecto-nanosecond precision), it will allow more than 7
digits in order to read strings from other sources that have higher
@@ -9273,13 +9275,14 @@ public:
/++
Creates a $(LREF SysTime) from a string with the format
- YYYY-MM-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the
- time zone). Whitespace is stripped from the given string.
+ YYYY-Mon-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ
+ is the time zone). Whitespace is stripped from the given string.
- The exact format is exactly as described in `toSimpleString` except
+ The exact format is exactly as described in $(LREF toSimpleString) except
that trailing zeroes are permitted - including having fractional seconds
- with all zeroes. However, a decimal point with nothing following it is
- invalid. Also, while $(LREF toSimpleString) will never generate a
+ with all zeroes. The time zone and fractional seconds are optional,
+ however, a decimal point with nothing following it is invalid.
+ Also, while $(LREF toSimpleString) will never generate a
string with more than 7 digits in the fractional seconds (because that's
the limit with hecto-nanosecond precision), it will allow more than 7
digits in order to read strings from other sources that have higher
diff --git a/libphobos/src/std/sumtype.d b/libphobos/src/std/sumtype.d
index 0dd636ea67b..3833c84243c 100644
--- a/libphobos/src/std/sumtype.d
+++ b/libphobos/src/std/sumtype.d
@@ -1569,27 +1569,7 @@ private enum bool isSumTypeInstance(T) = is(T == SumType!Args, Args...);
}
/// True if `T` is a [SumType] or implicitly converts to one, otherwise false.
-template isSumType(T)
-{
- static if (is(T : SumType!Args, Args...))
- {
- enum isSumType = true;
- }
- else static if (is(T == struct) && __traits(getAliasThis, T).length > 0)
- {
- // Workaround for https://issues.dlang.org/show_bug.cgi?id=21975
- import std.traits : ReturnType;
-
- alias AliasThisType = ReturnType!((T t) =>
- __traits(getMember, t, __traits(getAliasThis, T)[0])
- );
- enum isSumType = .isSumType!AliasThisType;
- }
- else
- {
- enum isSumType = false;
- }
-}
+enum bool isSumType(T) = is(T : SumType!Args, Args...);
///
@safe unittest
@@ -1610,25 +1590,6 @@ template isSumType(T)
assert(!isSumType!ContainsSumType);
}
-@safe unittest
-{
- static struct AliasThisVar(T)
- {
- SumType!T payload;
- alias payload this;
- }
-
- static struct AliasThisFunc(T)
- {
- SumType!T payload;
- ref get() { return payload; }
- alias get this;
- }
-
- static assert(isSumType!(AliasThisVar!int));
- static assert(isSumType!(AliasThisFunc!int));
-}
-
/**
* Calls a type-appropriate function with the value held in a [SumType].
*