gcc/testsuite/g++.dg/cpp1z/nontype6.C
raw| 1 | // PR c++/101463 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | int a; |
| 5 | |
| 6 | int& v = a; |
| 7 | |
| 8 | template<const int& = v> |
| 9 | void f(int) { } |
| 10 | |
| 11 | template<class T, int& = v> |
| 12 | void g(T) { } |
| 13 | |
| 14 | template<class T> |
| 15 | int& vt = a; |
| 16 | |
| 17 | template<class T, int& = vt<T>> |
| 18 | void h(T) { } |
| 19 | |
| 20 | int main() { |
| 21 | f(0); |
| 22 | g(0); |
| 23 | h(0); |
| 24 | } |