aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-pr67969.C
blob: 83dee7069fa0e7b9567eeb6cb05640aa7a5c5fb0 (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
30
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts" }
template <class, class>
class NumericArray {};

template <class>
constexpr bool match_numeric_array = false;
template <class Scalar, class Shape>
constexpr bool
    match_numeric_array<NumericArray<Scalar, Shape>> =
        true;
template <class T>
concept cpt_NumericArrayContainer =
  match_numeric_array<T>;

template <class X>
concept cpt_NumericArray =
  requires{requires cpt_NumericArrayContainer<X>;};


template <class X>
requires (!cpt_NumericArray<X>) auto func(int, X) {}

template <class X>
requires (cpt_NumericArray<X>) auto func(int, X) {}

int main() {
  NumericArray<double, int> v5;
  func(0, v5);
}