This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84866] New: Incorrectly instantiating move ctor when a union's move constructor is implicitly deleted
- From: "zhangxy at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 14 Mar 2018 15:09:16 +0000
- Subject: [Bug c++/84866] New: Incorrectly instantiating move ctor when a union's move constructor is implicitly deleted
- Auto-submitted: auto-generated
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.