Skip to content

Conversation

poelmanc
Copy link

@poelmanc poelmanc commented Oct 5, 2021

Per https://www.cplusplus.com/reference/string/string/string: "If s is a null pointer ... it causes undefined behavior."

This article by C++ Standards Committee member Aaron Ballman reinforces that: https://wiki.sei.cmu.edu/confluence/display/cplusplus/STR51-CPP.+Do+not+attempt+to+create+a+std%3A%3Astring+from+a+null+pointer

The MSVC 2022 Preview release, with /std:c++latest, flags this lines as an error.

Per https://www.cplusplus.com/reference/string/string/string: "If s is a null pointer ... it causes undefined behavior."

This article by C++ Standards Committee member Aaron Ballman reinforces that: https://wiki.sei.cmu.edu/confluence/display/cplusplus/STR51-CPP.+Do+not+attempt+to+create+a+std%3A%3Astring+from+a+null+pointer

The MSVC 2022 Preview release, with /std:c++latest, flags this lines as an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant