]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Wed, 9 Oct 2002 21:31:03 +0000 (21:31 +0000)
committerNo Author <no-author@gcc.gnu.org>
Wed, 9 Oct 2002 21:31:03 +0000 (21:31 +0000)
'gcc-3_2-branch'.

From-SVN: r57996

gcc/testsuite/g++.dg/ext/typedef-init.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/typedef-init.c [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/ext/typedef-init.C b/gcc/testsuite/g++.dg/ext/typedef-init.C
new file mode 100644 (file)
index 0000000..5602783
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-fpermissive" } // suppress default -pedantic-errors */
+
+/* This code used to be a legitimate, if dubious, extension.  However,
+   it's been broken since GCC 3.0 (caused ICE) and we have now removed
+   the extension.  See PR c/7353.
+
+   C++ issues a warning in addition to the error, since this construct
+   appears to be a case of implicit int (forbidden in std. C++) until
+   we get to the equals sign.  */
+
+typedef A = 0;  /* { dg-error "initialized" "typedef A = B" } */
+                /* { dg-warning "no type" "also warns" { target *-*-* } 12 } */
+A a;            /* { dg-bogus "" "no error cascade" } */
diff --git a/gcc/testsuite/gcc.dg/typedef-init.c b/gcc/testsuite/gcc.dg/typedef-init.c
new file mode 100644 (file)
index 0000000..9cb4830
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=gnu89" } // suppress default -pedantic-errors */
+
+/* This code used to be a legitimate, if dubious, extension.  However,
+   it's been broken since GCC 3.0 (caused ICE) and we have now removed
+   the extension.  See PR c/7353.  */
+
+typedef A = 0;  /* { dg-error "initialized" "typedef A = B" } */
+A a;            /* { dg-bogus "" "no error cascade" } */