Skip to content

[libc++] Remove <locale> includes from <format> #85478

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

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/include/__format/format_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <cstddef>

#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
# include <__locale>
# include <optional>
#endif

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__format/format_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <string_view>

#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
# include <__locale>
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__format/formatter_floating_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <cstddef>

#ifndef _LIBCPP_HAS_NO_LOCALIZATION
# include <locale>
# include <__locale>
#endif

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
4 changes: 4 additions & 0 deletions libcxx/include/format
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,8 @@ namespace std {
# pragma GCC system_header
#endif

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <locale>
#endif

#endif // _LIBCPP_FORMAT
5 changes: 5 additions & 0 deletions libcxx/test/libcxx/transitive_includes/cxx03.csv
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,14 @@ filesystem system_error
filesystem type_traits
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
Expand Down
5 changes: 5 additions & 0 deletions libcxx/test/libcxx/transitive_includes/cxx11.csv
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,14 @@ filesystem system_error
filesystem type_traits
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
Expand Down
5 changes: 5 additions & 0 deletions libcxx/test/libcxx/transitive_includes/cxx14.csv
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ filesystem system_error
filesystem type_traits
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
Expand Down
5 changes: 5 additions & 0 deletions libcxx/test/libcxx/transitive_includes/cxx17.csv
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,14 @@ filesystem system_error
filesystem type_traits
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
Expand Down
11 changes: 10 additions & 1 deletion libcxx/test/libcxx/transitive_includes/cxx20.csv
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,21 @@ charconv type_traits
charconv version
chrono array
chrono bit
chrono cctype
chrono cerrno
chrono charconv
chrono clocale
chrono cmath
chrono compare
chrono concepts
chrono cstddef
chrono cstdint
chrono cstdlib
chrono cstring
chrono ctime
chrono cwchar
chrono forward_list
chrono limits
chrono locale
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks controversial. Why is it correct to remove this include in C++20. (Not objections the change in C++23 and C++26.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I missed that removal. That wasn't meant to be here. Weird though that it's only showing up in C++20.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, I just approved it.

chrono optional
chrono ostream
chrono ratio
Expand Down Expand Up @@ -275,9 +279,14 @@ filesystem system_error
filesystem type_traits
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
Expand Down
16 changes: 14 additions & 2 deletions libcxx/test/libcxx/transitive_includes/cxx23.csv
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,20 @@ charconv limits
charconv new
charconv version
chrono array
chrono cctype
chrono cerrno
chrono clocale
chrono cmath
chrono compare
chrono cstddef
chrono cstdint
chrono cstdlib
chrono cstring
chrono ctime
chrono cwchar
chrono forward_list
chrono initializer_list
chrono limits
chrono locale
chrono new
chrono optional
chrono ostream
Expand All @@ -85,6 +90,8 @@ chrono sstream
chrono stdexcept
chrono string
chrono string_view
chrono tuple
chrono typeinfo
chrono vector
chrono version
cinttypes cstdint
Expand Down Expand Up @@ -184,12 +191,16 @@ filesystem string
filesystem string_view
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
format new
format optional
format queue
Expand All @@ -198,6 +209,7 @@ format stdexcept
format string
format string_view
format tuple
format typeinfo
format version
forward_list compare
forward_list cstddef
Expand Down
16 changes: 14 additions & 2 deletions libcxx/test/libcxx/transitive_includes/cxx26.csv
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,20 @@ charconv limits
charconv new
charconv version
chrono array
chrono cctype
chrono cerrno
chrono clocale
chrono cmath
chrono compare
chrono cstddef
chrono cstdint
chrono cstdlib
chrono cstring
chrono ctime
chrono cwchar
chrono forward_list
chrono initializer_list
chrono limits
chrono locale
chrono new
chrono optional
chrono ostream
Expand All @@ -85,6 +90,8 @@ chrono sstream
chrono stdexcept
chrono string
chrono string_view
chrono tuple
chrono typeinfo
chrono vector
chrono version
cinttypes cstdint
Expand Down Expand Up @@ -184,12 +191,16 @@ filesystem string
filesystem string_view
filesystem version
format array
format cctype
format clocale
format cmath
format cstddef
format cstdint
format cstdlib
format cstring
format cwchar
format initializer_list
format limits
format locale
format new
format optional
format queue
Expand All @@ -198,6 +209,7 @@ format stdexcept
format string
format string_view
format tuple
format typeinfo
format version
forward_list compare
forward_list cstddef
Expand Down