| 1 |
// PR c++/97340 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
template<class> |
| 5 |
struct A { |
| 6 |
template<class> |
| 7 |
static constexpr const int& var = 0; |
| 8 |
}; |
| 9 |
|
| 10 |
template<class T> |
| 11 |
struct B { |
| 12 |
static constexpr int x1 = A<T>::template var<int>; |
| 13 |
static constexpr int y1 = A<T>{}.template var<int>; |
| 14 |
|
| 15 |
static constexpr int x2 = A<int>::template var<T>; |
| 16 |
static constexpr int y2 = A<int>{}.template var<T>; |
| 17 |
|
| 18 |
static constexpr int x3 = A<int>::template var<int>; |
| 19 |
static constexpr int y3 = A<int>{}.template var<int>; |
| 20 |
}; |
| 21 |
|
| 22 |
template struct B<int>; |