PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / nontype25.C
blob3918bea4246b32e7e9b13a36fdf71e2626c853c0
1 // { dg-do compile }
3 class A {};
4 class B : public A {};
6 template<const A* a> class C {};
7 template<const B* b> class D {};
8 template<B* b> class E {};
10 template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" }
11 template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target { ! c++11 } } }
13 B b;
15 int main()
17   C<static_cast<const A*>(&b)> c; // { dg-error "" }
18   D<&b> d;
19   E<const_cast<B*>(&b)> e; // { dg-error "" "" { target { ! c++11 } } }
20   f(d, c);                 // { dg-error "" "" { target c++11 } }
21   g(d, e);