Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.old-deja/g++.ext/return1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do assemble } |
131 | 2 // { dg-options "-Wno-deprecated -Wno-return-type" } |
111 | 3 // Test that the named return value extension works when passed as a reference. |
4 // Origin: Jason Merrill <jason@redhat.com> | |
5 | |
6 void f (int &i) | |
7 { | |
8 i = 42; | |
9 } | |
10 | |
11 int g () return r // { dg-error "" } named return value | |
12 { | |
13 f (r); // { dg-error "" } undeclared | |
14 } | |
15 | |
16 int main () | |
17 { | |
18 int i = g (); | |
19 return (i != 42); | |
20 } |