diff --git a/std/base64.d b/std/base64.d index c9f7b2942..5c7912b35 100644 --- a/std/base64.d +++ b/std/base64.d @@ -1430,6 +1430,7 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=') */ class Base64Exception : Exception { + @safe pure nothrow this(string s, string fn = __FILE__, size_t ln = __LINE__) { super(s, fn, ln); diff --git a/std/conv.d b/std/conv.d index d0f577d83..737ce74e1 100644 --- a/std/conv.d +++ b/std/conv.d @@ -37,6 +37,7 @@ import std.format; */ class ConvException : Exception { + @safe pure nothrow this(string s, string fn = __FILE__, size_t ln = __LINE__) { super(s, fn, ln); @@ -65,6 +66,7 @@ private auto convError(S, T)(S source, int radix, string fn = __FILE__, size_t l fn, ln); } +@safe pure/* nothrow*/ // lazy parameter bug private auto parseError(lazy string msg, string fn = __FILE__, size_t ln = __LINE__) { return new ConvException(text("Can't parse string: ", msg), fn, ln); @@ -139,6 +141,7 @@ private */ class ConvOverflowException : ConvException { + @safe pure nothrow this(string s, string fn = __FILE__, size_t ln = __LINE__) { super(s, fn, ln); @@ -2169,7 +2172,7 @@ Target parse(Target, Source)(ref Source p) // static immutable string infinity = "infinity"; // static immutable string nans = "nans"; - ConvException bailOut(string msg = null, string fn = __FILE__, size_t ln = __LINE__) + ConvException bailOut()(string msg = null, string fn = __FILE__, size_t ln = __LINE__) { if (!msg) msg = "Floating point conversion error"; diff --git a/std/format.d b/std/format.d index ea270bf8d..8b3920e56 100644 --- a/std/format.d +++ b/std/format.d @@ -51,11 +51,13 @@ version (DigitalMarsC) */ class FormatException : Exception { + @safe pure nothrow this() { super("format error"); } + @safe pure nothrow this(string msg, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(msg, fn, ln, next); diff --git a/std/net/curl.d b/std/net/curl.d index c8ea19657..642519324 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -3357,6 +3357,7 @@ class CurlException : Exception line = The line number where the exception occurred. next = The previous exception in the chain of exceptions, if any. +/ + @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, @@ -3378,6 +3379,7 @@ class CurlTimeoutException : CurlException line = The line number where the exception occurred. next = The previous exception in the chain of exceptions, if any. +/ + @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, diff --git a/std/utf.d b/std/utf.d index 6c28b5a7c..215aa8c07 100644 --- a/std/utf.d +++ b/std/utf.d @@ -45,8 +45,8 @@ class UTFException : Exception uint[4] sequence; size_t len; - - UTFException setSequence(uint[] data...) @safe pure nothrow + @safe pure nothrow + UTFException setSequence(uint[] data...) { import std.algorithm; @@ -58,13 +58,13 @@ class UTFException : Exception return this; } - + @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { super(msg, file, line, next); } - + @safe pure this(string msg, size_t index, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { import std.string; diff --git a/std/windows/registry.d b/std/windows/registry.d index f3c7b62ca..452b2919a 100644 --- a/std/windows/registry.d +++ b/std/windows/registry.d @@ -68,11 +68,13 @@ class Win32Exception : Exception { int error; + @safe pure nothrow this(string message, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(message, fn, ln, next); } + @safe pure this(string message, int errnum, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(text(message, " (", errnum, ")"), fn, ln, next); @@ -116,6 +118,7 @@ public: Params: message = The message associated with the exception. */ + @safe pure this(string message, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(message, fn, ln, next); @@ -128,6 +131,7 @@ public: message = The message associated with the exception. error = The Win32 error number associated with the exception. */ + @safe pure this(string message, int error, string fn = __FILE__, size_t ln = __LINE__, Throwable next = null) { super(message, error, fn, ln, next); @@ -782,12 +786,14 @@ private void regProcessNthValue(HKEY hkey, scope void delegate(scope LONG delega */ class Key { + @safe pure nothrow invariant() { assert(m_hkey !is null); } private: + @safe pure nothrow this(HKEY hkey, string name, bool created) in { @@ -1147,12 +1153,14 @@ private: */ class Value { + @safe pure nothrow invariant() { assert(m_key !is null); } private: + @safe pure nothrow this(Key key, string name, REG_VALUE_TYPE type) in { @@ -1363,12 +1371,14 @@ foreach (string subkeyName; key.keyNames) */ class KeyNameSequence { + @safe pure nothrow invariant() { assert(m_key !is null); } private: + @safe pure nothrow this(Key key) { m_key = key; @@ -1458,12 +1468,14 @@ foreach (Key subkey; key.keys) */ class KeySequence { + @safe pure nothrow invariant() { assert(m_key !is null); } private: + @safe pure nothrow this(Key key) { m_key = key; @@ -1565,12 +1577,14 @@ foreach (string valueName; key.valueNames) */ class ValueNameSequence { + @safe pure nothrow invariant() { assert(m_key !is null); } private: + @safe pure nothrow this(Key key) { m_key = key; @@ -1659,12 +1673,14 @@ foreach (Value value; key.values) */ class ValueSequence { + @safe pure nothrow invariant() { assert(m_key !is null); } private: + @safe pure nothrow this(Key key) { m_key = key;