#include <iostream>
class A {};
typedef int (*j)() throw(A);
int f()
{
std::cout << "function f" << std::endl;
return 0;
}
int main()
{
j y = f;
y();
}
In all sites and Stroustrup too says that there will be compile error, but it compiles. Are there any changes in standard?
I know this is not an answer to this question -
MSVC 2010(that I have) throws no error, compiles fine and works without a hiccup
G++(GNU) says error: 'j' declared with an exception specification
Clang says error: exception specifications are not allowed in typedefs
Bottomline: Compiler bug in MSVC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With