[Bug c++/63707] Brace initialization of array sometimes fails if no copy constructor

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 30 13:22:00 GMT 2018


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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Testcase from PR 70395

struct NonCopyable {
  NonCopyable(const NonCopyable&) = delete;
  NonCopyable(NonCopyable&&) = delete;
  NonCopyable& operator=(const NonCopyable&) = delete;
  NonCopyable& operator=(NonCopyable&&) = delete;

  NonCopyable() {}

  ~NonCopyable() {} // to make it non-trivial
};

struct A {
  A(): _a{} {}
  ~A() {}

  NonCopyable _a[5];
} a;


More information about the Gcc-bugs mailing list