[CXX-2629] Remove requirement to set `/Zc:__cplusplus` in MSVC flags Created: 03/Jan/23  Updated: 28/Oct/23  Resolved: 12/Jan/23

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.7.1

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CXX-2055 Set /EHsc when building on Visual Studio Closed
Epic Link: CXX-2622
Quarter: FY24Q1

 Description   

Scope

Background & Motivation

The documentation currently notes it is required to configure with /Zc:__cplusplus to compile with MSVC for C++17. Adding it as a default removes an exception in the build for MSVC.



 Comments   
Comment by Githook User [ 14/Mar/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2629 Remove requirement to set `/Zc:__cplusplus` in MSVC flags (#924)

  • remove /EHsc from msvc2017 evg flags
  • remove requirement for /Zc:__cplusplus
  • remove /Zc:__cplusplus from documented requirements

Note option requirements for <= 3.7.0. Note /EHsc is required for <= 3.7.0.

Comment by Githook User [ 12/Jan/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2629 Remove requirement to set `/Zc:__cplusplus` in MSVC flags (#924)

  • remove /EHsc from msvc2017 evg flags
  • remove requirement for /Zc:__cplusplus
  • remove /Zc:__cplusplus from documented requirements

Note option requirements for <= 3.7.0. Note /EHsc is required for <= 3.7.0.

Comment by Githook User [ 12/Jan/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CXX-2629 Remove requirement to set `/Zc:__cplusplus` in MSVC flags (#924)

  • remove /EHsc from msvc2017 evg flags
  • remove requirement for /Zc:__cplusplus
  • remove /Zc:__cplusplus from documented requirements

Note option requirements for <= 3.7.0. Note /EHsc is required for <= 3.7.0.

Comment by Kevin Albertson [ 09/Jan/23 ]

Also consider: rather than check __cplusplus in the source, consider checking the _MSVC_LANG when compiling with MSVC. See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/

Generated at Wed Feb 07 22:06:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.