public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45657] New: Wrongly computed exception specification for destructor
@ 2010-09-13 15:34 schaub-johannes at web dot de
2010-09-13 16:55 ` [Bug c++/45657] " redi at gcc dot gnu dot org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: schaub-johannes at web dot de @ 2010-09-13 15:34 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/45657] Wrongly computed exception specification for destructor
2010-09-13 15:34 [Bug c++/45657] New: Wrongly computed exception specification for destructor schaub-johannes at web dot de
@ 2010-09-13 16:55 ` redi at gcc dot gnu dot org
2010-09-13 17:03 ` schaub-johannes at web dot de
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-09-13 16:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from redi at gcc dot gnu dot org 2010-09-13 16:55 -------
Not a regression, and G++ 4.6 correctly rejects it:
pr.cc:12:8: error: looser throw specifier for 'virtual Derived::~Derived()
throw (Viral::Dose)'
pr.cc:9:11: error: overriding 'virtual Base::~Base() throw ()'
EDG (Comeau online) also accepts it.
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Known to work| |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45657
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/45657] Wrongly computed exception specification for destructor
2010-09-13 15:34 [Bug c++/45657] New: Wrongly computed exception specification for destructor schaub-johannes at web dot de
2010-09-13 16:55 ` [Bug c++/45657] " redi at gcc dot gnu dot org
@ 2010-09-13 17:03 ` schaub-johannes at web dot de
2010-09-13 17:06 ` redi at gcc dot gnu dot org
2010-09-13 18:35 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: schaub-johannes at web dot de @ 2010-09-13 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from schaub-johannes at web dot de 2010-09-13 17:02 -------
Great(In reply to comment #1)
> Not a regression, and G++ 4.6 correctly rejects it:
>
> pr.cc:12:8: error: looser throw specifier for 'virtual Derived::~Derived()
> throw (Viral::Dose)'
> pr.cc:9:11: error: overriding 'virtual Base::~Base() throw ()'
>
> EDG (Comeau online) also accepts it.
>
Great, thanks for checking on 4.6. Can we mark it as resolved?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45657
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/45657] Wrongly computed exception specification for destructor
2010-09-13 15:34 [Bug c++/45657] New: Wrongly computed exception specification for destructor schaub-johannes at web dot de
2010-09-13 16:55 ` [Bug c++/45657] " redi at gcc dot gnu dot org
2010-09-13 17:03 ` schaub-johannes at web dot de
@ 2010-09-13 17:06 ` redi at gcc dot gnu dot org
2010-09-13 18:35 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu dot org @ 2010-09-13 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from redi at gcc dot gnu dot org 2010-09-13 17:06 -------
Jason, do you know if this was fixed as part of your noexcept work, or is it
still latent in trunk?
--
redi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45657
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/45657] Wrongly computed exception specification for destructor
2010-09-13 15:34 [Bug c++/45657] New: Wrongly computed exception specification for destructor schaub-johannes at web dot de
` (2 preceding siblings ...)
2010-09-13 17:06 ` redi at gcc dot gnu dot org
@ 2010-09-13 18:35 ` jason at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu dot org @ 2010-09-13 18:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jason at gcc dot gnu dot org 2010-09-13 18:35 -------
I'm sure this was fixed by my work on implicitly deleted functions, which
involved rewriting the calculation of exception specifications for implicitly
declared functions.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45657
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-09-13 18:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-13 15:34 [Bug c++/45657] New: Wrongly computed exception specification for destructor schaub-johannes at web dot de
2010-09-13 16:55 ` [Bug c++/45657] " redi at gcc dot gnu dot org
2010-09-13 17:03 ` schaub-johannes at web dot de
2010-09-13 17:06 ` redi at gcc dot gnu dot org
2010-09-13 18:35 ` jason at gcc dot gnu dot 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).