https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84866
Bug ID: 84866 Summary: Incorrectly instantiating move ctor when a union's move constructor is implicitly deleted Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhangxy at google dot com Target Milestone: --- Please see https://godbolt.org/g/5VTrtz for a reduced test case. The reasoning is: if is_move_constructor<T>() is true, I should be able to move construct a T (even though it might be using the copy ctor). Note: - The bug seems to be exist since early versions (tried 4.9). - The bug is not relevant to the standard versions, i.e. -std=c++11 or -std=c++17. - The bug only occurs when a type (with trivial copy ctor and nontrivial move ctor) is nested in a union, not when it is at top level of the union.