summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/volatile1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/volatile1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/volatile1.C b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
new file mode 100644
index 000000000..ca28ec8e4
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Test that failed lvalue-to-rvalue conversion of vf doesn't crash the
+// compiler.
+
+class f_class // { dg-message "note" "candidates" }
+{ };
+
+volatile f_class
+ret_v_f_class()
+{
+ f_class t;
+ return t;
+}
+
+int main(void)
+{
+ volatile f_class vf;
+ 0 ? ret_v_f_class() : vf; // { dg-error "match" } can't copy volatile lvalue
+ // { dg-message "candidate" "candidate note" { target *-*-* } 18 }
+ return 0;
+}