This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45657] New: Wrongly computed exception specification for destructor
- From: "schaub-johannes at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2010 15:34:35 -0000
- Subject: [Bug c++/45657] New: Wrongly computed exception specification for destructor
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This code is invalid, but is accepted by GCC:
// snip
struct Viral {
struct Dose { };
protected:
~Viral() throw (Dose) { }
};
struct Base : virtual Viral {
virtual ~Base() throw() { }
};
struct Derived : Base { };
// snap
~Derived calls ~Viral, which adds "Dose" to its exception spec. This yields to
a looser exception spec for ~Derived than for the overridden ~Base, which
should yield to an ill-formed program.
--
Summary: Wrongly computed exception specification for destructor
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schaub-johannes at web dot de
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45657