c++/5104: template using std::set_terminate fails due to throw() qualifier in <exception>

rodrigc@gcc.gnu.org rodrigc@gcc.gnu.org
Fri Dec 14 20:23:00 GMT 2001


Synopsis: template using std::set_terminate fails due to throw() qualifier in <exception>

State-Changed-From-To: open->analyzed
State-Changed-By: rodrigc
State-Changed-When: Fri Dec 14 20:23:17 2001
State-Changed-Why:
    As Phil Edwards mentioned, set_terminate() in libstdc++-v3 has the correct
    function prototype according to the C++ standard, so we can't change that.
    
    This is kind of tricky.   What you would like to be able to do in your
    example is:
    
    typedef HandlerFunction (*SetHandlerFunction)(HandlerFunction) throw();
    
    However, you cannot do this, because section 15.4.1 of the C++ standard
    states: "An exception-specification shall not appear in a typedef
    declaration".
    
    gcc is doing the right thing, but I don't know how you can code
    your example to do what you want without changing it around.
    
    If I were you I would post a question on comp.lang.c++.moderated
    and ask what the legal C++ equivalent of your example is.

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



More information about the Gcc-prs mailing list