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

            Bug ID: 120306
           Summary: Copy constructor with requires
                    (!std::copy_constructible<S>) is available
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

The following contradicting program
```
#include <concepts>

template <typename T>
struct S {
    S() = default;
    S(const S &) requires (!std::copy_constructible<S>) {}
};

S<int> u;
S<int> v(u);

static_assert( !std::copy_constructible<S<int>> );
```
is accepted starting from GCC 13, but fails in all other compilers. Online
demo: https://gcc.godbolt.org/z/qMWzjohnd

Reply via email to