2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / warn / return-reference.C
blob83021900dbd7696d6b6737cae14979cb84791b83
1 // { dg-do compile }
3 const int* bar();
5 const int&
6 foo1()
8   static int empty;
9   const int* x = bar();
10   return (x ? *x : empty);      // { dg-bogus ".*" "" { xfail *-*-* } }
13 const int&
14 foo2()
16   static int empty;
17   const int* x = bar();
18   const int& r = (x ? *x : empty);
19   return (r);