This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/25191] exception_defines.h #defines try/catch
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2008 00:07:56 -0000
- Subject: [Bug libstdc++/25191] exception_defines.h #defines try/catch
- References: <bug-25191-11686@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #48 from sebor at roguewave dot com 2008-06-03 00:07 -------
FWIW, let me throw out a suggestion for an implementation of Benjamin's (2)
in the C++ front end:
1. "try" is a no-op
2. "catch" blocks are syntax-checked but eliminated as dead code
3. "throw" checks to see if a user-defined handler is installed and if so,
calls it with useful arguments (e.g., the what() string); if no handler
is installed or if it returns, std::terminate() is called
4. function exception specification is diagnosed as a warning but otherwise
ignored (libc, libsupc++, and libstdc++ header should compile cleanly)
libsupc++ provides a __set_xxx() function to let users install the handler.
AFAIK, IBM XLC++ implements 1, 2, and 4 when -qnoeh is used. Apache stdcxx
implements 3 for exceptions thrown by the library.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25191