STL*_*mer 6 c++ typedef visual-studio-2012
#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();
}
Run Code Online (Sandbox Code Playgroud)
在所有站点和Stroustrup也说会有编译错误,但它编译.标准有变化吗?
我知道这不是这个问题的答案 -
MSVC 2010(我有)没有抛出任何错误,编译正常并且工作没有问题
G++(GNU) 说error: 'j' declared with an exception specification
铿锵 说error: exception specifications are not allowed in typedefs
底线:MSVC 中的编译器错误。