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

template <unsigned char DIM_FROM>
concept Geometry = (DIM_FROM == -1);

template <class INIT>
requires Geometry<INIT::n>
auto GaussNewton(const INIT& init) -> void {}

template<int N>
struct X {
  static constexpr int n = N;
};

int main() { GaussNewton(X<-1>{}); } // { dg-error "no match|narrowing" }