summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/cfg5.C
blob: a4bc8eea9d88e084581f31132ad60e541346cdb4 (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
/* PR rtl-optimization/34035 */
/* Origin: Janis Johnson <janis@gcc.gnu.org> */

/* { dg-do compile } */
/* { dg-options "-O2 -fnon-call-exceptions -ffast-math -fno-gcse" } */

class One {
public:
    One () { e[0] = e[1] = 0.0; }
    double e[2];
};

template <class T>
class Two {
public:
    Two();
private:
    T *data;
    int arraySize;
};

template <class T>
Two<T>::Two() {
   data = new T[arraySize];
}

class Three {
protected:
  Two<One> data;
};

class Four : public Three {
public:
  Four ();
  void Foo (int n);
};

Four :: Four (){
   Foo (1);
}