diff --git a/compiler/src/dmd/safe.d b/compiler/src/dmd/safe.d index 861efc8ea8..bb9cbe9f16 100644 --- a/compiler/src/dmd/safe.d +++ b/compiler/src/dmd/safe.d @@ -387,7 +387,12 @@ extern (D) void reportSafeError(FuncDeclaration fd, bool gag, Loc loc, if (fd.isSafe()) buf.writestring(" is not allowed in a `@safe` function"); else - buf.writestring(" is not allowed in a function with default safety with `-preview=safer`"); + { + version (IN_GCC) + buf.writestring(" is not allowed in a function with default safety with `-fpreview=safer`"); + else + buf.writestring(" is not allowed in a function with default safety with `-preview=safer`"); + } .error(loc, "%s", buf.extractChars()); } }