Skip to content

[libc++][NFC] Replace a few "namespace std" with the correct macro #140510

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
May 23, 2025
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
9 changes: 4 additions & 5 deletions libcxx/include/initializer_list
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
# pragma GCC system_header
# endif

namespace std // purposefully not versioned
{

# ifndef _LIBCPP_CXX03_LANG

_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD

template <class _Ep>
class _LIBCPP_NO_SPECIALIZATIONS initializer_list {
const _Ep* __begin_;
Expand Down Expand Up @@ -95,9 +94,9 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
return __il.end();
}

# endif // !defined(_LIBCPP_CXX03_LANG)
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD

} // namespace std
# endif // !defined(_LIBCPP_CXX03_LANG)

# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cstddef>
Expand Down
7 changes: 4 additions & 3 deletions libcxx/include/optional
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ namespace std {
_LIBCPP_PUSH_MACROS
# include <__undef_macros>

namespace std // purposefully not using versioning namespace
{
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS

class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access : public exception {
public:
Expand All @@ -257,7 +257,8 @@ public:
const char* what() const _NOEXCEPT override;
};

} // namespace std
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD

# if _LIBCPP_STD_VER >= 17

Expand Down
7 changes: 4 additions & 3 deletions libcxx/include/stdexcept
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ public:

_LIBCPP_END_NAMESPACE_STD

namespace std // purposefully not using versioning namespace
{
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS

class _LIBCPP_EXPORTED_FROM_ABI logic_error : public exception {
# ifndef _LIBCPP_ABI_VCRUNTIME
Expand Down Expand Up @@ -207,7 +207,8 @@ public:
# endif
};

} // namespace std
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD

_LIBCPP_BEGIN_NAMESPACE_STD

Expand Down
7 changes: 4 additions & 3 deletions libcxx/include/typeinfo
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public:
# include <vcruntime_typeinfo.h>
# else

namespace std // purposefully not using versioning namespace
{
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS

# if defined(_LIBCPP_ABI_MICROSOFT)

Expand Down Expand Up @@ -348,7 +348,8 @@ public:
const char* what() const _NOEXCEPT override;
};

} // namespace std
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD

# endif // defined(_LIBCPP_ABI_VCRUNTIME)

Expand Down
Loading