blob: e0981273b2e94484fb42625f2d613a84ad9d36cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// Test mangling of type casts
// { dg-do compile }
class A {};
class B : A {};
template<const A* a> class C {};
template<const B* b> class D {};
template<B* b> class E {};
template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {}
template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {}
B b;
int main()
{
C<static_cast<const A*>(&b)> c;
D<&b> d;
E<const_cast<B*>(&b)> e;
f(d, c);
g(d, e);
}
// { dg-final { scan-assembler "\n_?_Z1fIXadL_Z1bEEEvR1DIXT_EER1CIXcvPK1AT_EE\[: \t\n\]" } }
// { dg-final { scan-assembler "\n_?_Z1gIXadL_Z1bEEEvR1DIXT_EER1EIXcvP1BT_EE\[: \t\n\]" } }
|