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

            Bug ID: 121945
           Summary: g++ rejects constructor with unsatisfied constraint
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: avi at scylladb dot com
  Target Milestone: ---

Consider

```
#include <concepts>

template <typename T>
struct a {
    T v;
    a(a<int> x) requires (!std::same_as<T, int>) : v(x.v) {} 
};
```

g++ 15.2 complains:

```
error: invalid constructor; you probably meant 'a<int> (const a<int>&)
```

But the constructor should be ignored due to the unsatisfied constraint. For
any T that isn't `int`, it's a valid converting constructor.

Reply via email to