repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Winfinite-recursion.C
blob
faf0984eeb4b7d538c6d84514265d69cec0dd6f0
1
/* PR middle-end/88232 - Please implement -Winfinite-recursion
2
{ dg-do compile }
3
{ dg-options "-Wall -Winfinite-recursion" } */
4
5
template <typename D>
6
struct C
7
{
8
void foo () // { dg-warning "-Winfinite-recursion" }
9
{
10
static_cast<D *>(this)->foo ();
11
}
12
};
13
14
struct D : C<D>
15
{
16
// this is missing:
17
// void foo() {}
18
};
19
20
void f (D *d)
21
{
22
d->foo ();
23
}
24
25
26
struct E : C<D>
27
{
28
void foo() {}
29
};
30
31
void g (E *e)
32
{
33
e->foo ();
34
}