OSDN Git Service

* g++.dg/other/debug2.C: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / other / debug2.C
1 /* Verify that sched re-inserts needed scopes properly.  */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -g" } */
4 /* { dg-options "-O2 -g -mcpu=ev5" { target alpha*-*-* } } */
5
6 template <class T>
7 inline void foo()
8 {
9   void (T::*x)() __attribute__ ((__unused__)) = &T::bar;
10 }
11
12 template <class T>
13 struct D
14 {
15   void bar() {
16   }
17   T i;
18 };
19
20 template <class T>
21 struct E
22 {
23   void bar() {
24     foo <D<T> > ();
25     *i-- = *i;
26   }
27   T i;
28 };
29
30 struct A {};
31 template<typename T> struct B { typedef typename T::t t; };
32 template<typename T> struct B<T*> { typedef T& t; };
33 template<typename T>
34 struct C
35 {
36   T b;
37   explicit C (const T& i) : b (i) { }
38   typename B<T>::t operator* () const { return *b; }
39   C operator-- (int) { return C (b--); }
40 };
41
42 template void foo <E<C<A**> > > ();
43 template void foo <D<C<A**> > > ();