public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60125] New: defaulted constructor with throwing NSDMI still declared as noexcept
@ 2014-02-09 14:43 harald at gigawatt dot nl
  2014-02-09 14:55 ` [Bug c++/60125] " daniel.kruegler at googlemail dot com
  2015-05-07 18:28 ` [Bug c++/60125] [DR 1351] " jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: harald at gigawatt dot nl @ 2014-02-09 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60125
           Summary: defaulted constructor with throwing NSDMI still
                    declared as noexcept
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: harald at gigawatt dot nl

struct S {
  int i = (throw 0, 0);
  S() = default;
};
int main() {
  try {
    S();
  } catch(int i) {
    return i;
  }
}

The constructor for S is marked noexcept, and as a result, the exception thrown
from i's initialiser cannot be caught, and this program aborts.

This seems to be exactly what the standard requires: [except.spec]p14 says that
the noexcept specification depends only on the functions invoked by the
constructor. However, I'm reporting it anyway at the request of Marc Glisse,
who says it's worth reporting even if it's a bug in the standard
(http://stackoverflow.com/a/21660078/743382).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/60125] defaulted constructor with throwing NSDMI still declared as noexcept
  2014-02-09 14:43 [Bug c++/60125] New: defaulted constructor with throwing NSDMI still declared as noexcept harald at gigawatt dot nl
@ 2014-02-09 14:55 ` daniel.kruegler at googlemail dot com
  2015-05-07 18:28 ` [Bug c++/60125] [DR 1351] " jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-02-09 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This example corresponds to CWG issue 1351,

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1351

If the currently suggested wording would be accepted (see: "Proposed
resolution, April, 2013"), the bullet

"If f is a default constructor, the set also contains all members of the sets
of potential exceptions of the initialization of non-static data members from
brace-or-equal-initializers."

would apply and the default constructor would no longer be a noexcept
constructor.
>From gcc-bugs-return-443125-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Feb 09 14:58:20 2014
Return-Path: <gcc-bugs-return-443125-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23247 invoked by alias); 9 Feb 2014 14:58:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23222 invoked by uid 48); 9 Feb 2014 14:58:16 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60125] [DR 1351] defaulted constructor with throwing NSDMI still declared as noexcept
Date: Sun, 09 Feb 2014 14:58:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: SUSPENDED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on short_desc everconfirmed
Message-ID: <bug-60125-4-2wnSo4YPk6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60125-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60125-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg00882.txt.bz2
Content-length: 681

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`125

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2014-02-09
            Summary|defaulted constructor with  |[DR 1351] defaulted
                   |throwing NSDMI still        |constructor with throwing
                   |declared as noexcept        |NSDMI still declared as
                   |                            |noexcept
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/60125] [DR 1351] defaulted constructor with throwing NSDMI still declared as noexcept
  2014-02-09 14:43 [Bug c++/60125] New: defaulted constructor with throwing NSDMI still declared as noexcept harald at gigawatt dot nl
  2014-02-09 14:55 ` [Bug c++/60125] " daniel.kruegler at googlemail dot com
@ 2015-05-07 18:28 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-05-07 18:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60125

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|SUSPENDED                   |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
   Target Milestone|---                         |5.0

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed by r209907.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-07 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-09 14:43 [Bug c++/60125] New: defaulted constructor with throwing NSDMI still declared as noexcept harald at gigawatt dot nl
2014-02-09 14:55 ` [Bug c++/60125] " daniel.kruegler at googlemail dot com
2015-05-07 18:28 ` [Bug c++/60125] [DR 1351] " jason at gcc dot gnu.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).