Skip to content
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
6 changes: 3 additions & 3 deletions stl/inc/xlocale
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,12 @@ public:
return nullptr; // no entry in current locale
}

_NODISCARD bool operator==(const locale& _Loc) const { // compare locales for equality
return _Ptr == _Loc._Ptr || (name().compare("*") != 0 && name().compare(_Loc.name()) == 0);
_NODISCARD bool operator==(const locale& _Loc) const noexcept /* strengthened */ { // compare locales for equality
return _Ptr == _Loc._Ptr || (_CSTD strcmp(_C_str(), "*") != 0 && _CSTD strcmp(_C_str(), _Loc._C_str()) == 0);
}

#if !_HAS_CXX20
_NODISCARD bool operator!=(const locale& _Right) const {
_NODISCARD bool operator!=(const locale& _Right) const noexcept /* strengthened */ {
return !(*this == _Right);
}
#endif // !_HAS_CXX20
Expand Down
3 changes: 3 additions & 0 deletions tests/std/tests/Dev09_056375_locale_cleanup/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ using namespace std;

#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)

STATIC_ASSERT(noexcept(locale{} == locale{}));
STATIC_ASSERT(noexcept(locale{} != locale{}));

void test_dll() {
puts("Calling dll");
#ifdef _M_CEE
Expand Down