This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5104: template using std::set_terminate fails due to throw() qualifier in <exception>
- From: rodrigc at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, harald at tritan dot tn dot cornell dot edu, nobody at gcc dot gnu dot org, pedwards at disaster dot jaj dot com
- Date: 15 Dec 2001 04:23:18 -0000
- Subject: Re: c++/5104: template using std::set_terminate fails due to throw() qualifier in <exception>
- Reply-to: rodrigc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, harald at tritan dot tn dot cornell dot edu, nobody at gcc dot gnu dot org, pedwards at disaster dot jaj dot com, gcc-gnats at gcc dot gnu dot org
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