This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16565] New: Default destructor exception specification not handled consistently
- From: "nferguso at eso dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2004 12:00:11 -0000
- Subject: [Bug c++/16565] New: Default destructor exception specification not handled consistently
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Also appears in GCC versions 3.2.2 (red hat), 3.3, 3.4.0 and 3.4.1 for
i686-pc-linux-gnu, and 3.2 for sparc-sun-solaris2.8.
configure --enable-languages=c,c++ --disable-nls
g++ -c except.C -o except.o
where except.C is:
-- cut here --
class A
{
public:
virtual ~A() throw() {}
};
class B
{
public:
~B() {}
private:
int value;
};
class C : public A
{
private:
int number;
B object;
};
-- cut here --
gives:
-- cut here --
except.C:18: error: looser throw specifier for `virtual C::~C()'
except.C:5: error: overriding `virtual A::~A() throw ()'
-- cut here --
which seems fair enough. However, commenting out the destructor in class B of
except.C results in a successful compile, which strikes me as odd. Surely the
compiler should still have the same complaint?
--
Summary: Default destructor exception specification not handled
consistently
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nferguso at eso dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16565