aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-friend2.C
blob: d5f700c7d39d344a7602d069177eb50785274c40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { dg-do compile { target c++20 } }

template<typename T>
  concept Eq = requires(T t) { t == t; }; // { dg-message "in requirements" }

template<Eq T> struct Foo { };

template<typename T>
  struct S { // { dg-error "constraint failure" }
    template<Eq U> friend class Bar;

    friend class Foo<T>;
  };

struct X { };

int main() {
  S<int> si; // OK
  S<X> sx;
}