c-typeck.c (common_type): push and pop binding level around calling common_type on...
authorJakub Jelinek <jakub@redhat.com>
Mon, 5 Feb 2001 22:14:07 +0000 (23:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 5 Feb 2001 22:14:07 +0000 (23:14 +0100)
* c-typeck.c (common_type): push and pop binding level around
calling common_type on function parameters.

* gcc.c-torture/compile/20010202-1.c: New test.

From-SVN: r39467

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010202-1.c [new file with mode: 0644]

index 546dfc10ee9008f99805d5b7f9bbd7dd98564dac..8b01b13d8777eebd31926f65410d6b6c3e2af40d 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * c-typeck.c (common_type): push and pop binding level around
+       calling common_type on function parameters.
+
 Mon Feb  5 14:30:37 2001  Christopher Faylor <cgf@cygnus.com>
 
        * config/i386/cygwin.h (CPP_SPEC): Add missing space after -idirafter.
index 3b8f9b090cf2d4dee53609d1b1cf80110ead0dc6..1ff44d213693ac5db94b3cbf5af0e89e6aac09b2 100644 (file)
@@ -353,6 +353,9 @@ common_type (t1, t2)
        /* If both args specify argument types, we must merge the two
           lists, argument by argument.  */
 
+       pushlevel (0);
+       declare_parm_level (1);
+
        len = list_length (p1);
        newargs = 0;
 
@@ -412,6 +415,8 @@ common_type (t1, t2)
          parm_done: ;
          }
 
+       poplevel (0, 0, 0);
+
        t1 = build_function_type (valtype, newargs);
        /* ... falls through ...  */
       }
index 2cec5af45117ca8aff7690bbe742688c69df4839..3ce1ec37058d091b8bdab6df30b3675ed8f3e320 100644 (file)
@@ -1,3 +1,7 @@
+2001-02-05  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/compile/20010202-1.c: New test.
+
 2001-02-05  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.abi/primary2.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010202-1.c b/gcc/testsuite/gcc.c-torture/compile/20010202-1.c
new file mode 100644 (file)
index 0000000..e72586a
--- /dev/null
@@ -0,0 +1,6 @@
+int foo (int n, char m[1][n]);
+
+int foo (int n, char m[1][n])
+{
+}
+