diff --git a/src/dmd/dsymbol.d b/src/dmd/dsymbol.d index afc5cf3d9ab6..5685a869c517 100644 --- a/src/dmd/dsymbol.d +++ b/src/dmd/dsymbol.d @@ -349,7 +349,7 @@ extern (C++) class Dsymbol : ASTNode final bool checkDeprecated(const ref Loc loc, Scope* sc) { - if (global.params.useDeprecated != Diagnostic.off && isDeprecated()) + if (global.params.useDeprecated != DiagnosticReporting.off && isDeprecated()) { // Don't complain if we're inside a deprecated symbol's scope if (sc.isDeprecated()) diff --git a/src/dmd/errors.d b/src/dmd/errors.d index 064115e64d3f..0bce5111346b 100644 --- a/src/dmd/errors.d +++ b/src/dmd/errors.d @@ -322,12 +322,12 @@ extern (C++) void verrorSupplemental(const ref Loc loc, const(char)* format, va_ */ extern (C++) void vwarning(const ref Loc loc, const(char)* format, va_list ap) { - if (global.params.warnings != Diagnostic.off) + if (global.params.warnings != DiagnosticReporting.off) { if (!global.gag) { verrorPrint(loc, Classification.warning, "Warning: ", format, ap); - if (global.params.warnings == Diagnostic.error) + if (global.params.warnings == DiagnosticReporting.error) global.warnings++; } else @@ -346,7 +346,7 @@ extern (C++) void vwarning(const ref Loc loc, const(char)* format, va_list ap) */ extern (C++) void vwarningSupplemental(const ref Loc loc, const(char)* format, va_list ap) { - if (global.params.warnings != Diagnostic.off && !global.gag) + if (global.params.warnings != DiagnosticReporting.off && !global.gag) verrorPrint(loc, Classification.warning, " ", format, ap); } @@ -362,9 +362,9 @@ extern (C++) void vwarningSupplemental(const ref Loc loc, const(char)* format, v extern (C++) void vdeprecation(const ref Loc loc, const(char)* format, va_list ap, const(char)* p1 = null, const(char)* p2 = null) { __gshared const(char)* header = "Deprecation: "; - if (global.params.useDeprecated == Diagnostic.error) + if (global.params.useDeprecated == DiagnosticReporting.error) verror(loc, format, ap, p1, p2, header); - else if (global.params.useDeprecated == Diagnostic.inform) + else if (global.params.useDeprecated == DiagnosticReporting.inform) { if (!global.gag) { @@ -408,9 +408,9 @@ extern (C++) void vmessage(const ref Loc loc, const(char)* format, va_list ap) */ extern (C++) void vdeprecationSupplemental(const ref Loc loc, const(char)* format, va_list ap) { - if (global.params.useDeprecated == Diagnostic.error) + if (global.params.useDeprecated == DiagnosticReporting.error) verrorSupplemental(loc, format, ap); - else if (global.params.useDeprecated == Diagnostic.inform && !global.gag) + else if (global.params.useDeprecated == DiagnosticReporting.inform && !global.gag) verrorPrint(loc, Classification.deprecation, " ", format, ap); } diff --git a/src/dmd/expressionsem.d b/src/dmd/expressionsem.d index dc5adf2ceb55..c63175596341 100644 --- a/src/dmd/expressionsem.d +++ b/src/dmd/expressionsem.d @@ -8530,7 +8530,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor return setError(); } - if (0 && global.params.warnings != Diagnostic.off && !global.gag && exp.op == TOK.assign && + if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == TOK.assign && e2x.op != TOK.slice && e2x.op != TOK.assign && e2x.op != TOK.arrayLiteral && e2x.op != TOK.string_ && !(e2x.op == TOK.add || e2x.op == TOK.min || @@ -8594,7 +8594,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor } else { - if (0 && global.params.warnings != Diagnostic.off && !global.gag && exp.op == TOK.assign && + if (0 && global.params.warnings != DiagnosticReporting.off && !global.gag && exp.op == TOK.assign && t1.ty == Tarray && t2.ty == Tsarray && e2x.op != TOK.slice && t2.implicitConvTo(t1)) diff --git a/src/dmd/globals.d b/src/dmd/globals.d index f2853bbd5756..0ea8a23a91f2 100644 --- a/src/dmd/globals.d +++ b/src/dmd/globals.d @@ -34,7 +34,7 @@ enum TARGET : bool DragonFlyBSD = xversion!`DragonFlyBSD`, } -enum Diagnostic : ubyte +enum DiagnosticReporting : ubyte { error, // generate an error inform, // generate a warning @@ -132,7 +132,7 @@ struct Param bool isSolaris; // generate code for Solaris bool hasObjectiveC; // target supports Objective-C bool mscoff = false; // for Win32: write MsCoff object files instead of OMF - Diagnostic useDeprecated = Diagnostic.inform; // how use of deprecated features are handled + DiagnosticReporting useDeprecated = DiagnosticReporting.inform; // how use of deprecated features are handled bool stackstomp; // add stack stomping code bool useUnitTests; // generate unittest code bool useInline = false; // inline expand functions @@ -140,7 +140,7 @@ struct Param bool noDIP25; // revert to pre-DIP25 behavior bool release; // build release version bool preservePaths; // true means don't strip path from source file - Diagnostic warnings = Diagnostic.off; // how compiler warnings are handled + DiagnosticReporting warnings = DiagnosticReporting.off; // how compiler warnings are handled bool pic; // generate position-independent-code for shared libs bool color; // use ANSI colors in console output bool cov; // generate code coverage data diff --git a/src/dmd/lexer.d b/src/dmd/lexer.d index 2ad44e72223c..97a7ae03fe3a 100644 --- a/src/dmd/lexer.d +++ b/src/dmd/lexer.d @@ -333,7 +333,7 @@ This is usually the default diagnostic reporter. */ final class StderrDiagnosticReporter : DiagnosticReporter { - private const Diagnostic useDeprecated; + private const DiagnosticReporting useDeprecated; private int errorCount_; private int warningCount_; @@ -346,7 +346,7 @@ final class StderrDiagnosticReporter : DiagnosticReporter useDeprecated = indicates how deprecation diagnostics should be handled */ - this(Diagnostic useDeprecated) + this(DiagnosticReporting useDeprecated) { this.useDeprecated = useDeprecated; } @@ -392,7 +392,7 @@ final class StderrDiagnosticReporter : DiagnosticReporter { vdeprecation(loc, format, args); - if (useDeprecated == Diagnostic.error) + if (useDeprecated == DiagnosticReporting.error) errorCount_++; else deprecationCount_++; diff --git a/src/dmd/mars.d b/src/dmd/mars.d index 3de3ba1f478c..3fa37daeb9ea 100644 --- a/src/dmd/mars.d +++ b/src/dmd/mars.d @@ -1573,11 +1573,11 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param if (arg == "-allinst") // https://dlang.org/dmd.html#switch-allinst params.allInst = true; else if (arg == "-de") // https://dlang.org/dmd.html#switch-de - params.useDeprecated = Diagnostic.error; + params.useDeprecated = DiagnosticReporting.error; else if (arg == "-d") // https://dlang.org/dmd.html#switch-d - params.useDeprecated = Diagnostic.off; + params.useDeprecated = DiagnosticReporting.off; else if (arg == "-dw") // https://dlang.org/dmd.html#switch-dw - params.useDeprecated = Diagnostic.inform; + params.useDeprecated = DiagnosticReporting.inform; else if (arg == "-c") // https://dlang.org/dmd.html#switch-c params.link = false; else if (startsWith(p + 1, "checkaction")) // https://dlang.org/dmd.html#switch-checkaction @@ -2009,9 +2009,9 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, ref Param params.useDIP25 = false; } else if (arg == "-w") // https://dlang.org/dmd.html#switch-w - params.warnings = Diagnostic.error; + params.warnings = DiagnosticReporting.error; else if (arg == "-wi") // https://dlang.org/dmd.html#switch-wi - params.warnings = Diagnostic.inform; + params.warnings = DiagnosticReporting.inform; else if (arg == "-O") // https://dlang.org/dmd.html#switch-O params.optimize = true; else if (p[1] == 'o') diff --git a/src/dmd/semantic3.d b/src/dmd/semantic3.d index dedfd6c858a2..0bc6b1870d5e 100644 --- a/src/dmd/semantic3.d +++ b/src/dmd/semantic3.d @@ -1384,7 +1384,7 @@ private extern(C++) final class Semantic3Visitor : Visitor // don't do it for unused deprecated types // or error ypes - if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated != Diagnostic.error) && (ad.type && ad.type.ty != Terror)) + if (!ad.getRTInfo && Type.rtinfo && (!ad.isDeprecated() || global.params.useDeprecated != DiagnosticReporting.error) && (ad.type && ad.type.ty != Terror)) { // Evaluate: RTinfo!type auto tiargs = new Objects(); diff --git a/src/dmd/sideeffect.d b/src/dmd/sideeffect.d index 98108ca223c4..f9e321512e9b 100644 --- a/src/dmd/sideeffect.d +++ b/src/dmd/sideeffect.d @@ -251,7 +251,7 @@ bool discardValue(Expression e) } case TOK.call: /* Issue 3882: */ - if (global.params.warnings != Diagnostic.off && !global.gag) + if (global.params.warnings != DiagnosticReporting.off && !global.gag) { CallExp ce = cast(CallExp)e; if (e.type.ty == Tvoid)