aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-class3.C
blob: 68b50b71278b10f8e0c885c2ffcfce2e997054d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// PR c++/103831
// { dg-do compile { target c++20 } }

struct A {
  constexpr int size() { return 42; } // non-static
};

template<class T>
  requires (T::size() == 42) // { dg-error "without object" }
struct B : T { };

template struct B<A>; // { dg-error "constraint" }