aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder12.C
blob: 22f0ac5e26a150c984baee82ab81d8726612f586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/109160
// { dg-do compile { target c++20 } }

template<class T, bool B>
concept C = B;

template<int> struct X { };

template<bool B>
struct A {
  template<C<B> auto V> static void f();
  template<C<B> auto V> static void g(X<V>);
  template<C<B> auto V> static inline int value;
  template<C<B> auto V> struct D { };
};

int main() {
  A<true>::f<0>();
  A<false>::f<0>(); // { dg-error "no match|constraints" }

  A<true>::g(X<0>{});
  A<false>::g(X<0>{}); // { dg-error "no match|constraints" }

  bool v1 = A<true>::value<0>;
  bool v2 = A<false>::value<0>;  // { dg-error "constraints" }

  A<true>::D<0> d1;
  A<false>::D<0> d2; // { dg-error "constraints" }
}