https://issues.dlang.org/show_bug.cgi?id=22192
Paul Backus <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Summary|[The D Bug Tracker] |Inconsistent attribute | |inference for template | |member function --- Comment #1 from Paul Backus <[email protected]> --- More reduced version of the inconsistent attribute inference issue: --- struct S() { public void initialize() {} } version(NotInferred) // void() pragma(msg, typeof(S!().initialize)); else // pure nothrow @nogc @safe void() pragma(msg, typeof(S!()().initialize)); --- More reduced version of the alignment issue: --- struct S { align(1) int* p; } auto fun(int* p) { S s; s.p = p; return s; } // pure nothrow @nogc @safe S(int* p) pragma(msg, typeof(fun)); --- I am not sure the second one is actually a bug. The language spec section on pointers [1] does not say anything about misaligned pointer variables potentially causing undefined behavior, and I have not been able to come up with an example that uses such a variable to cause undefined behavior in @safe code. For now, I've edited the name of this bugzilla issue to refer to the attribute-inference issue in the first example, since that one's definitely a bug. [1] https://dlang.org/spec/arrays.html#pointers --
