This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: middle-end/8405: GCC 3.2: 'throw "exception";' not caught by catch


Synopsis: GCC 3.2: 'throw "exception";' not caught by catch

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Wed Oct 30 12:55:51 2002
State-Changed-Why:
    Not a bug. An exception specification attached to a function
    does not imply any conversion of the exception actually thrown.
    
    You have to throw std::string("something").
    
    The program aborts since the exception actually thrown
    does not match the exception specification of the function.
    I don't know it right off my head what happens exactly in
    this case (look it up in any book on C++), but this leads
    either to raising a special exception or calling
    uncaught_exception or some such function. In any case,
    the catch(...) clause is not invoked in this case.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]