This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/84866] New: Incorrectly instantiating move ctor when a union's move constructor is implicitly deleted


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]