tree-optimization/116481 - avoid building function_type[]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / var-templ84a.C
blob4aa3a2a7245e17db837b52d6f91045a23f908fbc
1 // PR c++/71954
2 // A version of var-templ84.C where the partial specializations depend on
3 // outer template parameters.
4 // { dg-do compile { target c++14 } }
6 template<class T>
7 struct A {
8   template<class U, class V> static const int var = 0;
9   template<class U> static const int var<U*, T> = 1;
10   template<class U> static const int var<const U*, T> = 2;
13 static_assert(A<int>::var<int, int> == 0, "");
14 static_assert(A<int>::var<int*, int> == 1, "");
15 static_assert(A<int>::var<const int*, int> == 2, "");
17 static_assert(A<int>::var<int, char> == 0, "");
18 static_assert(A<int>::var<int*, char> == 0, "");
19 static_assert(A<int>::var<const int*, char> == 0, "");