简体   繁体   中英

Is MSVC 2010 a C++11-standard-compliant compiler

I was about to use google test for unit testing our MSVC 2010 based project, but the README.md file of the gtest v1.10.x branch (the current latest) mentions a C++11-standard-compliant compiler in the Build Requirements section.

So is MSVC 2010 a C++11-standard-compliant compiler, or should I rather use gtest v1.7.0 which mentions Microsoft Visual C++ 7.1 or newer in the Windows Requirements section?

Around 2017, we had been facing too many random crashes with apps built using MSVC10 & MSVC11 compilers. Upon analyzing this, we identified that the standard C++ library calls were the cause for the crashes though we did nothing wrong, and the code was perfectly written.

After some struggle debugging and study, we identified that Microsoft's C++11 implementation was non standard and buggy, and caused unnecessary crashes . For us, even the basic wait_for call on condition_variable had random crashes. Here is one such MSDN reference for you.

We contacted Microsoft regarding this, and their reply was,

"I'm sorry, but no hotfixes for this bug are available. I strongly recommend upgrading to the latest released version of VS (currently VS 2017 15.4), as we have fixed many bugs in the STL's multithreading machinery over the years."

We had to move all our projects to VS2017 (The latest one at that time) to get rid of the crashes. I wouldn't recommend you using those buggy compilers either.

Better stick to older compilers(VC8/VC9) or move to the latest one (VS2019). We had no issues after migrating to VS2017.

No, MSVC 2010 is not fully C++11 compliant. However, it does provide many C++11 features. You could try and compile the latest google_test with it, or just use an older version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM