Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/nontype7.C

raw
1 // PR c++/117792
2 // { dg-do compile { target c++17 } }
3
4 template<const int& N, class T>
5 void f(T) { }
6
7 template<int N, class T>
8 void f(...) = delete;
9
10 template<const int& N> int v;
11
12 template<const int& N> struct A { };
13
14 template<class T>
15 void g() {
16 static constexpr int local_static = 0;
17 auto x = v<local_static>; // OK
18 A<local_static> y; // OK
19 f<local_static>(0); // ICE
20 }
21
22 template void g<int>();