public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13944] [3.3/3.4/3.5] exception in constructor of a class to be thrown is not caught
Date: Mon, 16 Feb 2004 03:07:00 -0000	[thread overview]
Message-ID: <20040216030737.7017.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040131120212.13944.debian-gcc@lists.debian.org>


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-16 03:07 -------
I do not believe there is any ambiguity in the standard here.

This program should clearly through an exception of type "int" with the value
"1", and that exception should be caught in "main".

The problem here is that we have gotten too clever in build_throw; we try to
construct the object of type "A" directly into the exception object that will be
thrown.  That eliminates the separation between the evaluation of the operand
and the construction of the temporary that is required by the standard.  The
standard allows us to eliminate the temporary only if that does not change the
meaning of the program other than by changing what constructors/destructors are
called; in this case, it changes whether or not "terminate" is called.

The changes in build_throw are an attempt at an optimization, but that
optimization is not valid unless we can prove that no exceptions will be thrown.
 Optimizing this case doesn't seem very important to me, given that exceptions
are already assumed to be off the fast path.

Jason, you seem to have been the one who introduced the optimization.  

Would you please revert your changes, or, alternatively rebut my claims above?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com
         AssignedTo|unassigned at gcc dot gnu   |jason at redhat dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13944


  parent reply	other threads:[~2004-02-16  3:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-31 12:02 [Bug c++/13944] New: " debian-gcc at lists dot debian dot org
2004-02-02  2:10 ` [Bug c++/13944] [3.3/3.4/3.5] " giovannibajo at libero dot it
2004-02-02  7:43 ` pinskia at gcc dot gnu dot org
2004-02-02 23:18 ` bangerth at dealii dot org
2004-02-15 12:43 ` gdr at gcc dot gnu dot org
2004-02-16  3:07 ` mmitchel at gcc dot gnu dot org [this message]
2004-02-16  4:09 ` [Bug c++/13944] [3.3/3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-16 18:22 ` jason at redhat dot com
2004-02-16 18:27 ` jason at redhat dot com
2004-02-24 18:30 ` cvs-commit at gcc dot gnu dot org
2004-02-24 18:30 ` cvs-commit at gcc dot gnu dot org
2004-02-24 19:57 ` gdr at integrable-solutions dot net
2004-03-02 11:10 ` [Bug c++/13944] [3.3/3.4 " steven at gcc dot gnu dot org
2004-03-02 17:17 ` jason at redhat dot com
2004-03-02 19:57 ` cvs-commit at gcc dot gnu dot org
2004-03-02 20:30 ` [Bug c++/13944] [3.3 " pinskia at gcc dot gnu dot org
2004-03-02 20:44 ` gdr at integrable-solutions dot net
2004-03-02 20:54 ` jason at redhat dot com
2004-03-02 21:06 ` gdr at integrable-solutions dot net
2004-03-03  7:40 ` cvs-commit at gcc dot gnu dot org
2004-03-03 16:28 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040216030737.7017.qmail@sources.redhat.com \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).