My experiments with exceptions and throw lists in particular lead me into this problem: I can't compile with GCC the following code, which works just fine, if the commented non-const versions get used. Perhaps someone has an idea why can't a pointer to const object be specified? In other code without polymorhism and without inheritance I can specify a const pointer into a throw list and it works... Code here:
You're code's difficult to read with your one space indentation. It's not clear what version of the code gave you an error. The error text suggests that you mixed const/non const throws in base/child.
I took a quick look at this and simplified the code to illustrate the issue. I have to say, I'm still thoroughly confused. The below does not compile on my version of g++, BUT, if you remove either the virtual keyword from the fx() methods OR the const keyword from the throw specification, it compiles without complaint. I am assuming this is an issue with g++, but perhaps someone more knowledgeable can spot the error :)
1>main.cpp(11) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
1>main.cpp(18) : warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)