void foo() { static assert(false); } void main() { static assert( __traits(compiles, foo()) == false ); } The assert fails, but should not. Looks similar to bug 3448.
Assertion in `foo` should fail because `foo` is a regular function and compiles independently of assertion in `main`. This code compiles: --- void foo()() { static assert(false); } void main() { static assert(!__traits(compiles, foo!()())); } --- Note, that due to bug 3448 __traits(compiles) works correctly only if it is in a function.