public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/69373] GCC emits incorrect warning that "exception of type ‘void (*)()’ will be caught by earlier handler for 'void*'"
       [not found] <bug-69373-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-20 11:17 ` redi at gcc dot gnu.org
  2021-12-09  1:19 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2020-03-20 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69373

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2016-08-06 00:00:00         |2020-3-20

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The warning is present in the oldest release I checked (4.0.4) and in current
mainline.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/69373] GCC emits incorrect warning that "exception of type ‘void (*)()’ will be caught by earlier handler for 'void*'"
       [not found] <bug-69373-4@http.gcc.gnu.org/bugzilla/>
  2020-03-20 11:17 ` [Bug c++/69373] GCC emits incorrect warning that "exception of type ‘void (*)()’ will be caught by earlier handler for 'void*'" redi at gcc dot gnu.org
@ 2021-12-09  1:19 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-09  1:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69373

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the following patch fixes the warning:
apinski@xeond:~/src/upstream-gcc/gcc/gcc/cp$ git diff except.c
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index a8acbc4b7b2..28d7810e182 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -949,7 +949,8 @@ can_convert_eh (tree to, tree from)
       if (! at_least_as_qualified_p (to, from))
        return false;

-      if (VOID_TYPE_P (to))
+      if (VOID_TYPE_P (to)
+         && TREE_CODE (TREE_TYPE (from)) != FUNCTION_TYPE)
        return true;

       /* Else fall through.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09  1:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-69373-4@http.gcc.gnu.org/bugzilla/>
2020-03-20 11:17 ` [Bug c++/69373] GCC emits incorrect warning that "exception of type ‘void (*)()’ will be caught by earlier handler for 'void*'" redi at gcc dot gnu.org
2021-12-09  1:19 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).