https://issues.dlang.org/show_bug.cgi?id=18494
--- Comment #1 from FeepingCreature <default_357-l...@yahoo.de> --- Reproduce: class Class { invariant { new Object; } void foo() @nogc { } } void test() @nogc { (new Class).foo; } void main() { test(); } Expected: error about gc allocation in @nogc violation Outcome: runs silently Further wrinkle: void foo() @nogc in { new Object; } body { } ^ this one errors! Either the second function should work (preferred) or the first one should also error. --