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

#include <cassert>

template<typename T>
  concept C = __is_class(T);

template<typename T>
  concept D = C<T> && __is_empty(T);

struct X { } x;
struct Y { int n; } y;

int called = 0;

template<typename T>
  struct S {
    void f() requires C<T>;
  };

template<> void S<int>::f() { called = 1; } // { dg-error "match" }