Skip to content

Commit

Permalink
wording of error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed Oct 6, 2014
1 parent 31b8ff1 commit ea3237b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/statement.c
Expand Up @@ -692,7 +692,7 @@ int Statement::blockExit(FuncDeclaration *func, bool mustNotThrow)
void visit(CompoundAsmStatement *s)
{
if (mustNotThrow && !(s->stc & STCnothrow))
s->deprecation("asm block is not nothrow");
s->deprecation("asm statement is assumed to throw - mark it with 'nothrow' if it does not");

// Assume the worst
result = BEfallthru | BEreturn | BEgoto | BEhalt;
Expand Down Expand Up @@ -5069,11 +5069,11 @@ CompoundAsmStatement *CompoundAsmStatement::semantic(Scope *sc)
// use setImpure/setGC when the deprecation cycle is over
PURE pure;
if (!(stc & STCpure) && (pure = sc->func->isPureBypassingInference()) != PUREimpure && pure != PUREfwdref)
deprecation("asm block is not pure");
deprecation("asm statement is assumed to be impure - mark it with 'pure' if it is not");
if (!(stc & STCnogc) && sc->func->isNogcBypassingInference())
deprecation("asm block is not @nogc");
deprecation("asm statement is assumed to use the GC - mark it with '@nogc' if it does not");
if (!(stc & (STCtrusted|STCsafe)) && sc->func->setUnsafe())
error("asm block is not @trusted or @safe");
error("asm statement is assumed to be @system - mark it with '@trusted' if it is not");

return this;
}
Expand Down
2 changes: 1 addition & 1 deletion test/compilable/deprecate12979a.d
Expand Up @@ -4,7 +4,7 @@
/*
TEST_OUTPUT:
---
compilable/deprecate12979a.d(13): Deprecation: asm block is not nothrow
compilable/deprecate12979a.d(13): Deprecation: asm statement is assumed to throw - mark it with 'nothrow' if it does not
---
*/

Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/deprecate12979a.d
Expand Up @@ -4,7 +4,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/deprecate12979a.d(14): Deprecation: asm block is not nothrow
fail_compilation/deprecate12979a.d(14): Deprecation: asm statement is assumed to throw - mark it with 'nothrow' if it does not
fail_compilation/deprecate12979a.d(12): Error: function 'deprecate12979a.foo' is nothrow yet may throw
---
*/
Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/deprecate12979b.d
Expand Up @@ -4,7 +4,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/deprecate12979b.d(13): Deprecation: asm block is not pure
fail_compilation/deprecate12979b.d(13): Deprecation: asm statement is assumed to be impure - mark it with 'pure' if it is not
---
*/

Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/deprecate12979c.d
Expand Up @@ -4,7 +4,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/deprecate12979c.d(13): Deprecation: asm block is not @nogc
fail_compilation/deprecate12979c.d(13): Deprecation: asm statement is assumed to use the GC - mark it with '@nogc' if it does not
---
*/

Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/deprecate12979d.d
Expand Up @@ -3,7 +3,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/deprecate12979d.d(12): Error: asm block is not @trusted or @safe
fail_compilation/deprecate12979d.d(12): Error: asm statement is assumed to be @system - mark it with '@trusted' if it is not
---
*/

Expand Down
2 changes: 1 addition & 1 deletion test/fail_compilation/fail327.d
@@ -1,7 +1,7 @@
/*
TEST_OUTPUT:
---
fail_compilation/fail327.d(10): Error: asm block is not @trusted or @safe
fail_compilation/fail327.d(10): Error: asm statement is assumed to be @system - mark it with '@trusted' if it is not
---
*/

Expand Down

0 comments on commit ea3237b

Please sign in to comment.