summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/goto1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/goto1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/goto1.C21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/goto1.C b/gcc/testsuite/g++.old-deja/g++.other/goto1.C
new file mode 100644
index 000000000..0dcc8bc00
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/goto1.C
@@ -0,0 +1,21 @@
+// { dg-do assemble }
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ S ();
+ ~S ();
+};
+
+void f ()
+{
+ {
+ S s1; // { dg-error "" } skips initialization
+
+ t: // { dg-error "" } jump to label
+ S s2;
+ ;
+ }
+
+ goto t; // { dg-error "" } from here
+}