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

            Bug ID: 105615
           Summary: Partial ordering of constraints with empty parameter
                    mapping
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pilarlatiesa at gmail dot com
  Target Milestone: ---

The following testcase is accepted by GCC 10 and newer versions:

```
template<typename>
constexpr bool b = true;

template<typename T>
concept C = b<T>;

template<typename T, typename U>
class foo
{
public:
  void bar() const requires C<T> {}

  void bar() const requires (C<T> && C<U>) {}
};

int main()
{
  foo<int, int> x;

  x.bar();

  return 0;
}
```

However, if we make the concept independent of the template parameter, it fails
to compile:

```
template<typename T>
concept C = true;

template<typename T, typename U>
class foo
{
public:
  void bar() const requires C<T> {}

  void bar() const requires (C<T> && C<U>) {}
};

int main()
{
  foo<int, int> x;

  x.bar();

  return 0;
}
```

Reply via email to