VC2010 sp1编译器崩溃 [英] VC2010 sp1 Compiler crash
本文介绍了VC2010 sp1编译器崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我设法使用以下代码使编译器崩溃。我用2012测试版进行了测试,它没有崩溃。
I managed to crash the compiler with following code. I tested it with 2012 beta and it does not crash.
#include <functional>
#include <iostream>
class CompilerCrash
{
public:
explicit CompilerCrash( std::function<void()> f )
{
}
};
#define CrashMacro(x) CompilerCrash cc([]()x);
// 1 for crash
// 0 for no crash
#if 0
CrashMacro({
std::cout << "oh no!\n";
try{} // Compiler crash
catch(...){}
});
#else
CrashMacro({
std::cout << "oh no!\n";
//try{} // No crash when commented
//catch(...){}
});
#endif
int main(int argc, char * argv[])
{
return 0;
}
致命错误C1001:编译器发生内部错误。 (编译器文件'msc1.cpp',第1420行)
fatal error C1001: An internal error has occurred in the compiler. (compiler file 'msc1.cpp', line 1420)
推荐答案
如果可以重现内部错误,最好办法是报告
http ://connect.microsoft.com/
这样,相关产品团队就会查看错误。如果问题对您很重要,请将链接发回此处,以便我们对错误进行投票/评论。
That way the bug will be looked at by the appropriate product team. If the problem is important to you, post the link back here so that we can vote / comment on the bug.
这篇关于VC2010 sp1编译器崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文