summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/rfg18.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/rfg18.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/rfg18.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/rfg18.C b/gcc/testsuite/g++.old-deja/g++.jason/rfg18.C
new file mode 100644
index 000000000..9c32b1f02
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/rfg18.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Any expression may be explicitly converted to type void.
+
+struct S { int m[10]; } object;
+struct S f () { return object; }
+
+void
+test ()
+{
+ (void) f().m; /* OK - cast to void; see constraints in 3.8.1 */
+}