This problem may also happen if you have a unit test project that has a different C++ version than the project you want to test.
Example:
- EXE with C++ 17 enabled explicitly
- Unit Test with C++ version set to "Default"
Solution: change the Unit Test to C++17 as well.