public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7004: The program aborts if a function with exception-specification throws an exception that is not listed
@ 2002-06-14  9:56 lerdsuwa
  0 siblings, 0 replies; 2+ messages in thread
From: lerdsuwa @ 2002-06-14  9:56 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, vzw00011

Synopsis: The program aborts if a function with exception-specification throws an exception that is not listed

State-Changed-From-To: open->closed
State-Changed-By: lerdsuwa
State-Changed-When: Fri Jun 14 09:51:07 2002
State-Changed-Why:
    Not a bug.  According to the standard (section 15.5.2,
    18.6.2, 18.6.3) when a thrown exception doesn't match those
    mentioned in the exception specification, it calls
    unexpected().  The default behavior of unexpected()
    is calling terminate() which in turn aborts the program.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7004


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

* c++/7004: The program aborts if a function with exception-specification throws an exception that is not listed
@ 2002-06-12  6:16 vzw00011
  0 siblings, 0 replies; 2+ messages in thread
From: vzw00011 @ 2002-06-12  6:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         7004
>Category:       c++
>Synopsis:       The program aborts if a function with exception-specification throws an exception that is not listed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 12 06:16:03 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     vzw00011@nifty.ne.jp
>Release:        3.1
>Organization:
>Environment:
Linux orange.fruits 2.4.19-pre3 #4 Fri Mar 15 21:50:55 JST 2002 i586 unknown
>Description:
When gcc compiles the code, gcc output no error or warning. but, the program abort.
I think that it is safe that gcc complains compile-error or warning.
>How-To-Repeat:
#include <exception>
#include <cstdio>

class MyException: public std::exception { };

void g() throw(MyException) { throw MyException(); }
void f() throw() { g(); }

int main() {
    try { f(); }
    catch (MyException& e) {
        printf("MyException thrown.\n");
    }
    catch (...) {
        printf("something thrown.\n");
    }
    return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-06-14 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-14  9:56 c++/7004: The program aborts if a function with exception-specification throws an exception that is not listed lerdsuwa
  -- strict thread matches above, loose matches on Subject: below --
2002-06-12  6:16 vzw00011

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).