parent
ab61c93f12
commit
598f25beb6
21
gcc/testsuite/g++.dg/warn/return-reference.C
Normal file
21
gcc/testsuite/g++.dg/warn/return-reference.C
Normal file
@ -0,0 +1,21 @@
|
||||
// { dg-do compile }
|
||||
|
||||
const int* bar();
|
||||
|
||||
const int&
|
||||
foo1()
|
||||
{
|
||||
static int empty;
|
||||
const int* x = bar();
|
||||
return (x ? *x : empty);
|
||||
}
|
||||
|
||||
const int&
|
||||
foo2()
|
||||
{
|
||||
static int empty;
|
||||
const int* x = bar();
|
||||
const int& r = (x ? *x : empty);
|
||||
return (r);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user