https://issues.dlang.org/show_bug.cgi?id=13589

--- Comment #6 from Kenji Hara <[email protected]> ---
OK, I found a better explanation.

If an asm statement does not have attributes, its attribute will be inferred
from the *explicitly specified* attributes on enclosing function.

void f1() {
  asm {...}
  // f1 has no explicit attributes, so asm is inferred as system, impure,
throwable
}

void f2()() {
  asm {...}
  // f2 has no explicit attributes, so asm is inferred as system, impure,
throwable
}

void f3() @safe pure {
  asm {...}
  // f3 has explicit @safe attribute, so asm is inferred as @trusted, pure, but
throwable
}

void f4()() @truested nothrow {
  asm {...}
  // f4 has explicit @safe attribute, so asm is inferred as @trusted, nothrow ,
but impure
}

--

Reply via email to