except.c (add_new_handler): Complain about additional handlers after one that catches...
authorJason Merrill <jason@yorick.cygnus.com>
Sun, 29 Nov 1998 23:01:19 +0000 (23:01 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 29 Nov 1998 23:01:19 +0000 (18:01 -0500)
* except.c (add_new_handler): Complain about additional handlers
after one that catches everything.

From-SVN: r23990

gcc/ChangeLog
gcc/except.c

index 987262b037b0de48fc66c7d19970db4c0fcdb4f1..c00c1b5a0188d8980670eab286e6523df1b6c11e 100644 (file)
@@ -1,3 +1,8 @@
+Sun Nov 29 22:59:40 1998  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * except.c (add_new_handler): Complain about additional handlers
+       after one that catches everything.
+
 Sat Nov 28 10:56:32 1998  Jeffrey A Law  (law@cygnus.com)
 
        * configure.in (alpha*-*-netbsd): Fix typo.
index ae6ede2f112f2fc8361f317513299c25b9c61b84..70e19ef1045333075182bd3df03fcbf80559998d 100644 (file)
@@ -767,8 +767,13 @@ add_new_handler (region, newhandler)
     function_eh_regions[region].handlers = newhandler;
   else 
     {
-      for ( ; last->next != NULL; last = last->next)
-        ;
+      for ( ; ; last = last->next)
+       {
+         if (last->type_info == CATCH_ALL_TYPE)
+           pedwarn ("additional handler after ...");
+         if (last->next == NULL)
+           break;
+       }
       last->next = newhandler;
     }
 }