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

            Bug ID: 90537
           Summary: Implement P1286R2, Contra CWG DR1778
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

(NB: This assumes that my
<https://gcc.gnu.org/ml/gcc-patches/2019-05/msg00511.html> has gone in.)

Implement <http://wg21.link/p1286r2>.  This should compile now:

struct X { X(); };

struct A {
  struct B {
    B() noexcept(A::value) = default;
    X x;
  };
  decltype(B()) b;
  static constexpr bool value = true;
};
A::B b;

static_assert(noexcept(A::B()), "");

but we print

p1286.C:11:6: error: use of deleted function ‘A::B::B()’
   11 | A::B b;
      |      ^
p1286.C:5:5: note: ‘A::B::B() noexcept’ is implicitly deleted because its
exception-specification does not match the implicit exception-specification ‘’
    5 |     B() noexcept(A::value) = default;
      |     ^
p1286.C:13:29: error: use of deleted function ‘A::B::B()’
   13 | static_assert(noexcept(A::B()), "");
      |                             ^

Latest clang/EDG compile it fine.

Reply via email to