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]

[Bug libstdc++/25191] exception_defines.h #defines try/catch



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


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