2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / debug / debug1.C
blob3efcbc98f4270c8e949ab64c0f70344409b998fc
1 // Test whether dwarf2 debug info works with named return value optimization
2 // { dg-do compile }
4 struct S
6   virtual ~S();
7   S (const char *str);
8   S& operator= (const char *str);
9   operator const char *() const;
10   S& operator+= (const char *str);
12 inline S operator+ (const char *s1, const S &s2)
14   S x (s1);
15   x += s2;
16   return x;
18 struct U
20   U ();
21   U& operator= (const char *);
22   const char *foo() const;
23   operator const char *() const { return foo(); }
25 template <class T> struct V
27   T v;
29 template <class T> struct W
31   V<T> *w;
32   W() : w (0) {}
33   const T& operator* () const { return w->v; }
34   T& operator* () { return w->v; }
36 struct X {
37   X();
39 struct Y {
40   Y (const U &u);
42 X::X()
44   W<U> a;
45   U b;
46   b = (*a) + "xx";
47   Y c (b);