OSDN Git Service

PR c/14114
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Mar 2004 09:28:51 +0000 (09:28 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 6 Mar 2004 09:28:51 +0000 (09:28 +0000)
* gcc.dg/decl-5.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79012 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/decl-5.c [new file with mode: 0644]

index 00a174a..ee99b80 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-06  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       PR c/14114
+       * gcc.dg/decl-5.c: New test.
+
 2004-03-05  Andreas Krebbel  <krebbel1@de.ibm.com>
 
        * gcc.dg/20040305-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/decl-5.c b/gcc/testsuite/gcc.dg/decl-5.c
new file mode 100644 (file)
index 0000000..d7c36a4
--- /dev/null
@@ -0,0 +1,20 @@
+/* PR c/14114 */
+/* Origin: <snyder@fnal.gov> */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+/* This used to fail because the compiler thought that the
+   declaration of 'c' from 'b' was shadowing that from 'a'.  */
+
+void a()
+{
+  void c();
+  c();
+} /* { dg-bogus "error" "PR c/14114" { xfail *-*-* } } */
+
+void b()
+{
+  void c();
+}
+
+void c() {}