Enhance /std documentation with reference to /Zc:__cplusplus - #5010
Conversation
This change makes it much clearer as to what is required for C++ standards conformance when using the /std option - Specify Language Standard Version for C++. Motivation: The /std option implies standards conformance to C++ standards, yet it does not provide the most basic of conformance as it does not predefine the __cplusplus macro as mandated by the C++ standard (in section "Predefined macro names" - [cpp.predefined]). In order to conform to the standard, the /Zc:__cplusplus option is additionally required and this should be very clear in the documentation.
|
William S Fulton (@wsfulton) : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
|
Learn Build status updates of commit 113ee82: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
Can you review the proposed changes? When the changes are ready for publication, add a #label:"aq-pr-triaged" |
Add info about what to set __cplusplus to
|
William S Fulton (@wsfulton) : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
minor housekeeping
Tyler Whitney (TylerMSFT)
left a comment
There was a problem hiding this comment.
William S Fulton (@wsfulton), thank you for making this valuable contribution to the docs. I augmented it a little to provide more context.
Really appreciate you taking the time to make this update.
|
Learn Build status updates of commit 3059e82: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
Learn Build status updates of commit 1356b99: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
#sign-off |
|
Learn Build status updates of commit 8c8f2dc: 💡 Validation status: suggestions
docs/build/reference/std-specify-language-standard-version.md
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. For any questions, please:
|
|
Thank you, Tyler Whitney (@TylerMSFT)! |
|
Learn Build status updates of commit c54b897: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
|
Thanks Tyler Whitney (@TylerMSFT), wonderful that this information can be conveyed on the However, I do feel that the simple one sentence I proposed is perhaps clearer, more relevant and succinct for the I'm not sure repeating the details of the exact values of The reasons you added for not setting Obviously it would be the right thing if I would suggest this combination: |
|
We can't tell people they have to set it and then not tell them to what, or hope they go to another topic to find the info. I'll keep the table. |
|
Tyler Whitney (@TylerMSFT), I am sorry, but am a confused by the last comment as users don't need to set the value of If you feel a table is needed on the
|
|
I see what you are saying. I update this in PR #5538 |
|
Excellent, thanks, I found the commit to main here: 2e67cbc |
This change makes it much clearer as to what is required for C++ standards conformance when using the /std option - Specify Language Standard Version for C++.
Motivation: The /std option implies standards conformance to C++ standards, yet it does not provide the most basic of conformance as it does not predefine the __cplusplus macro as mandated by the C++ standard (in section "Predefined macro names" - [cpp.predefined]). In order to conform to the standard, the /Zc:__cplusplus option is additionally required and this should be very clear in the documentation.