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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-02-07
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org,
                   |                            |redi at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This boils down to:
template <typename T>
struct C {
  C () noexcept = default;
  ~C () noexcept = default;
  C (const C&) = delete;
  C& operator= (const C&) = delete;
  C& operator=(const C&) volatile = delete;
  constexpr C (T *x) noexcept : p(x) { }
  T *p = nullptr;
};

class A {
  struct B {
    int c;
    C<B*> d[];
  };
  void foo (int f) { B s; s.c = f; }
  B e;
};

which is rejected since GCC 6 e.g. in -std=c++17 mode, starting with
r6-6747-g05dd97db3c29364ea3fc8fc2a658586a9469db79
.  What is important is that = nullptr NSDMI (in the std::atomic case inside of
__atomic_base<T *> template).

On the libstdc++-v3 side, this changed with
r10-5914-ge4379a931d140a71b36eaecceace319837fda321

Given the flexible array member we are outside of the standard territory, so
the question is if we want to support that and if yes, what we want to do in
that case.

Reply via email to