Maybe that the option you suggest
This is best done with something like -fstatic-exception-specifications or maybe - Wexception-specifications -Werror.
is ideal, but it seems to me not practical at all. Every stuff using the throw qualifier as specified in the standards will not work. If an inline method in a standard header is theInlineMethod (void) throw () { throw theException(); }; this will not even compile... Of course, using an extension as the one I propose, some of the standard methods must be wrapped if you want to use the new qualifier in order to track the possible exceptions that the methods may arise, but I think it is quite more practical to wrap such methods than to modify the headers... In addition, the semantic meaning is not the same: a throw (a,b,c) qualifier indicates that you are able only to catch the exceptions a, b and c, and that every other exception will be seen as std::unexpected. Nevertheless, a _throw(a,b,c) qualifier should indicate that the only exceptions that can arise are a, b and c . With respect to this:
If you wanted finer control, having an inheritable attribute that says, please statically check exception specifications for all member functions in this class and/ or on the function would be better than replicating the entire mechanism.
I think that a lot of information can be obtained by using existing mechanisms. The calculation of the exceptions a module may arise under pessimistic assumptions is rather easy, if you don't allow template exceptions to be used in the _throw qualifier. I think that the hard step is to put it into gcc. I will be grateful for any advise on how to start looking add in order to implement this new feature. Cheers, Sergio On 3/30/07, Mike Stump <[EMAIL PROTECTED]> wrote:
On Mar 30, 2007, at 11:59 AM, Sergio Giro wrote: > The errors mentioned are compile errors, So, you want a strict subset of the language standard. This is best done with something like -fstatic-exception-specifications or maybe - Wexception-specifications -Werror. If you wanted finer control, having an inheritable attribute that says, please statically check exception specifications for all member functions in this class and/ or on the function would be better than replicating the entire mechanism.