This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1703: g++ creates default destructor with wrong `throw' signature
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1703: g++ creates default destructor with wrong `throw' signature
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 19 Jan 2001 18:28:56 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
>Number: 1703
>Category: c++
>Synopsis: g++ creates default destructor with wrong `throw' signature
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jan 19 10:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
CVS of 2001/01/19
>Description:
For the following, gcc errors out:
deal.II/base> cat tt.cc
struct X { ~X(); };
struct base { virtual ~base() throw(); };
struct d2 : public base { X x; };
deal.II/base> c++ -c tt.cc -o /dev/null
tt.cc:3: looser throw specifier for `virtual d2::~d2()'
tt.cc:2: overriding `virtual base::~base() throw ()'
I would argue that gcc should create a default destructor for
class d2 with no-throw signature, just as for the base class,
since otherwise one would be forced to write empty destructors
all over the place just to get the throw signature right.
Best regards
Wolfgang
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: