blob: 1414fbe52b71ab58111f858c605943c5227ce363 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/* { dg-do compile } */
/* { dg-options "-std=c++11 -O2" } */
class A
{
public:
void
getValueType ()
{
}
void getTypeClass ();
};
template <typename ImplClass> class B
{
public:
void
Visit (A *p1)
{
p1->getTypeClass ();
static_cast<ImplClass *> (0)->VisitAtomicType (0);
}
};
class C : B<C>
{
template <typename Fn>
void
dumpChild (Fn p1)
{
p1 ();
}
public:
void dumpTypeAsChild (int);
void
VisitAtomicType (A *p1)
{
p1->getValueType ();
dumpTypeAsChild (0);
}
};
void
C::dumpTypeAsChild (int)
{
dumpChild ([=]
{
Visit (0);
});
}
|