I assume CPLAT has a base class? I also assume that you did not put the throw specifier on the CPLAT destructor?
You can put throw(X) (where X is a comma-separated list of exceptions) at the end of the function signature to indicate which exceptions it allowed to throw. If you put throw() as the throw specifier, then this indicates that no exceptions can be thrown from this function. This happens quite often with destructors, since you never want the destructor to throw an exception.
A class that overrides a function that has a throw specifier cannot have a looser throw specifier (a list of additional exceptions) than a redefinable function, since this indicates that the function of the derived class may violate the throw class specifier of the base class'. The absence of a throw specifier means that any exception can be thrown from this function, so it becomes free as it can receive.
In all likelihood, you need to add throw() to the end of the CPLAT destructor function signature.
Edit: By the way, I should add that you probably don't want to use throw specifiers (except throw() for destructors), not knowing that this is what you want. Unlike Java checked exceptions, they do not get caught at compile time, but rather interrupt your program at run time if they break. Therefore, it is better not to use them if you do not know what you are doing.
Jonathan m davis
source share