Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr61540.C
blobe297fe360dce3d622227e5089536dfca10f4c66c
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-early-inlining" } */
4 struct data {
5   data(int) {}
6 };
8 struct top {
9   virtual int topf() { return 0; }
12 struct intermediate: top {
13     int topf() /* override */ { return 0; }
16 struct child1: top {
17     void childf()
18     {
19         data d(topf());
20     }
23 struct child2: intermediate {};
25 void test(top& t)
27     child1& c = static_cast<child1&>(t);
28     c.childf();
29     child2 d;
30     test(d);
33 int main (int argc, char **argv)
35   child1 c;
36   test (c);
37   return 0;