[英]Internal compiler error (CL version: 14.27.29110)
有代碼
#include <array>
struct Foo {
int bar;
};
int main() {
constexpr auto v = std::array{Foo{}};
return 0;
}
用 C++17 編譯時:
致命錯誤 C1001:內部編譯器錯誤。 ...(編譯器文件“msc1.cpp”,第 1591 行) “C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86”中的內部編譯器錯誤\\x86\\CL.exe'
但這 - 編譯
#include <array>
struct Foo {
int bar;
};
int main() {
constexpr std::array<Foo, 1> v{Foo{}};
return 0;
}
如描述的所有優化被禁用在這里
這是編譯器錯誤嗎?
這看起來與developercommunity.visualstudio.com在Regression: c++ internal compiler error in 16.7.0 with /std:c++17 (compiler file 'msc1.cpp', line 1591)下報告的錯誤相同。 我建議您對該錯誤報告進行投票,並密切關注它以尋找可能的解決方案。
該問題是在 16.7.0 更新中引入的,在最新的 16.7.5 中尚未修復。 臨時解決方法是恢復到 16.6.5,或刪除/std:c++17
並改用/std:default
或/std:c++14
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.