-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libcxx] don't #include <cwchar>
if wide chars aren't enabled
#99911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,21 +237,21 @@ namespace std { | |
# include <cstdint> | ||
# include <cstdlib> | ||
# include <cstring> | ||
# include <cwchar> | ||
# include <initializer_list> | ||
# include <limits> | ||
# include <locale> | ||
# include <new> | ||
# include <optional> | ||
# include <queue> | ||
# include <stack> | ||
# include <stdexcept> | ||
# include <string> | ||
# include <string_view> | ||
# include <tuple> | ||
#endif | ||
|
||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we changing the behaviour here? This PR is protecting the include for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're not changing the behaviour. If you expand this window to see the lines above, you'll see that the exact same conditional guards the includes above. I merged the two sections to make the code clearer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can that be made clearer in the commit message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 – if two of us misread the patch in the same way, then I think it's likely that future readers would benefit from the clarification! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I think we'll loose or bury this convo if I force-push, I've updated the description in my automated first comment in this thread. I'll update the description when I merge it. Unless there's a better way to handle this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea whether that will do what you want, so good luck with getting the right version of the commit message into the final commit! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you force-push over the current commit it should keep this conversation, not sure GitHub will delete it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, let me give it a shot now that I've got approval. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah that did work. Googling says comments don't disappear if the lines they're on don't change. Seems like they do still disappear if the lines change: https://github.com/orgs/community/discussions/3478. |
||
# include <locale> | ||
# include <queue> | ||
# include <stack> | ||
# if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) | ||
# include <cwchar> | ||
# endif | ||
#endif | ||
|
||
#endif // _LIBCPP_FORMAT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message doesn't say anything about why you've also made the includes of
<locale>
,<queue>
and<stack>
unconditional. Was that change included in this patch by mistake? If it was on purpose, could you update the commit message to explain why it's related or necessary?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not making them unconditional. If you expand this window to see the lines above, you'll see that the exact same conditional guards the includes above.
I merged the two sections to make the code clearer.