1// { dg-do compile }
2
3class A {};
4class B : public A {};
5
6template<const A* a> class C {};
7template<const B* b> class D {};
8template<B* b> class E {};
9
10template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" }
11template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target { ! c++11 } } }
12
13B b;
14
15int main()
16{
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);
22}
23