You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__traits(hasMember, T, "__xdtor") is true in some cases where there is no __xdtor member #20547
when compiling, and it prints out nothing when it runs.
S6 should not have a destructor, because while the elements of its static array have destructors, the static array has no length, and so, there's nothing to destroy.
The fact that nothing prints out when running the program shows that S6 has no destructor. allMembers also has no __xdtor member, which lines up with the behavior of the running program. However, for some reason, hasMember reports that there is an __xdtor member.
Given that allMembers matches the actual behavior, I'm inclined to think that the bug is in hasMember rather than there being an invisible __xdtor that allMembers isn't reporting, but either way, there is a discrepancy here which needs to be fixed.
This affects the implementation of {core.internal,std}.traits.hasElaborateDestructor.
Activity
thewilsonator commentedon Apr 13, 2025
which is... not an error I would expect, but still fails.
thewilsonator commentedon Apr 13, 2025
cc @RazvanN7 you last touched this for #15406
jmdavis commentedon Feb 9, 2026
#22524 is probably related to this in some manner, though if so, the issue manifests differently in each case.