This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81660] New: Learn GCC -Wexceptions
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Aug 2017 07:07:11 +0000
- Subject: [Bug c++/81660] New: Learn GCC -Wexceptions
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81660
Bug ID: 81660
Summary: Learn GCC -Wexceptions
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
CC: mpolacek at gcc dot gnu.org
Target Milestone: ---
Clang can show some diagnostics about:
$ cat exception.cpp
void
a (int b)
{
if (b)
throw;
try
{
a (3);
}
catch (int)
{
}
catch (int)
{
}
}
$ clang++ exception.cpp
exception.cpp:13:10: warning: exception of type 'int' will be caught by earlier
handler [-Wexceptions]
catch (int)
^
exception.cpp:10:10: note: for type 'int'
catch (int)
^
Maybe we can also do similar warning?