summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/warning8.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/warning8.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/warning8.C17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/warning8.C b/gcc/testsuite/g++.old-deja/g++.jason/warning8.C
new file mode 100644
index 000000000..b5ff3f3de
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/warning8.C
@@ -0,0 +1,17 @@
+// { dg-do assemble }
+
+struct A {
+ A();
+ ~A();
+};
+
+struct B {
+ B (const A&);
+ ~B ();
+};
+
+const B& f ()
+{
+ A a;
+ return a; // { dg-warning "" } returning reference to temporary
+}