Skip to content

Commit 1d411f2

Browse files
authored
[libc++][NFC] Replace a few "namespace std" with the correct macro (#140510)
We've added a new macro for the unversioned `namespace std` cases in #133009, but it seems we've missed a few places. This fixes the places I just found.
1 parent eb341f0 commit 1d411f2

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

libcxx/include/initializer_list

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ template<class E> const E* end(initializer_list<E> il) noexcept; // constexpr in
5353
# pragma GCC system_header
5454
# endif
5555

56-
namespace std // purposefully not versioned
57-
{
58-
5956
# ifndef _LIBCPP_CXX03_LANG
6057

58+
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
59+
6160
template <class _Ep>
6261
class _LIBCPP_NO_SPECIALIZATIONS initializer_list {
6362
const _Ep* __begin_;
@@ -95,9 +94,9 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Ep* end(initia
9594
return __il.end();
9695
}
9796

98-
# endif // !defined(_LIBCPP_CXX03_LANG)
97+
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
9998

100-
} // namespace std
99+
# endif // !defined(_LIBCPP_CXX03_LANG)
101100

102101
# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
103102
# include <cstddef>

libcxx/include/optional

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ namespace std {
244244
_LIBCPP_PUSH_MACROS
245245
# include <__undef_macros>
246246

247-
namespace std // purposefully not using versioning namespace
248-
{
247+
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
248+
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
249249

250250
class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access : public exception {
251251
public:
@@ -257,7 +257,8 @@ public:
257257
const char* what() const _NOEXCEPT override;
258258
};
259259

260-
} // namespace std
260+
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
261+
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
261262

262263
# if _LIBCPP_STD_VER >= 17
263264

libcxx/include/stdexcept

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public:
7373

7474
_LIBCPP_END_NAMESPACE_STD
7575

76-
namespace std // purposefully not using versioning namespace
77-
{
76+
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
77+
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
7878

7979
class _LIBCPP_EXPORTED_FROM_ABI logic_error : public exception {
8080
# ifndef _LIBCPP_ABI_VCRUNTIME
@@ -207,7 +207,8 @@ public:
207207
# endif
208208
};
209209

210-
} // namespace std
210+
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
211+
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
211212

212213
_LIBCPP_BEGIN_NAMESPACE_STD
213214

libcxx/include/typeinfo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ public:
7676
# include <vcruntime_typeinfo.h>
7777
# else
7878

79-
namespace std // purposefully not using versioning namespace
80-
{
79+
_LIBCPP_BEGIN_UNVERSIONED_NAMESPACE_STD
80+
_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
8181

8282
# if defined(_LIBCPP_ABI_MICROSOFT)
8383

@@ -348,7 +348,8 @@ public:
348348
const char* what() const _NOEXCEPT override;
349349
};
350350

351-
} // namespace std
351+
_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
352+
_LIBCPP_END_UNVERSIONED_NAMESPACE_STD
352353

353354
# endif // defined(_LIBCPP_ABI_VCRUNTIME)
354355

0 commit comments

Comments
 (0)