https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89164

            Bug ID: 89164
           Summary: can construct vector with
                    non-copyable-but-trivially-copyable elements
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Consider (from https://stackoverflow.com/q/54498610/2069064):

#include <vector>

struct X {
  X() = default;
  X(const X&) = delete;
};

std::vector<X> v{X{}};

X is trivially copyable, but it isn't actually copy constructible... as a
result X isn't Cpp17EmplaceConstructible into std::vector<X> right? libstdc++
just emits a memmove anyway.

libc++ rejects this.

Reply via email to