From 0c62e65e3b464be95cd88de65d4cb90e61e3d2fe Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sat, 8 Nov 2025 08:28:12 -0800 Subject: [PATCH 1/2] Remove ipfx(), isfx(), opfx(), and osfx(). --- stl/inc/__msvc_ostream.hpp | 12 +++------ stl/inc/istream | 12 +++------ stl/inc/yvals_core.h | 11 +------- .../test.compile.pass.cpp | 27 ++++--------------- 4 files changed, 14 insertions(+), 48 deletions(-) diff --git a/stl/inc/__msvc_ostream.hpp b/stl/inc/__msvc_ostream.hpp index 38622ad5977..1ebb296a080 100644 --- a/stl/inc/__msvc_ostream.hpp +++ b/stl/inc/__msvc_ostream.hpp @@ -130,12 +130,9 @@ class basic_ostream : virtual public basic_ios<_Elem, _Traits> { // control inse bool _Ok; // true if stream state okay at construction }; -#pragma push_macro("opfx") -#pragma push_macro("osfx") -#undef opfx -#undef osfx +#ifdef _CRTBLD // TRANSITION, ABI: non-Standard opfx() is preserved for binary compatibility - _DEPRECATE_IO_PFX_SFX bool __CLR_OR_THIS_CALL opfx() { // test stream state and flush tie stream as needed + bool __CLR_OR_THIS_CALL opfx() { // test stream state and flush tie stream as needed if (!this->good()) { return false; } @@ -150,11 +147,10 @@ class basic_ostream : virtual public basic_ios<_Elem, _Traits> { // control inse } // TRANSITION, ABI: non-Standard osfx() is preserved for binary compatibility - _DEPRECATE_IO_PFX_SFX void __CLR_OR_THIS_CALL osfx() noexcept { // perform any wrapup + void __CLR_OR_THIS_CALL osfx() noexcept { // perform any wrapup _Osfx(); } -#pragma pop_macro("osfx") -#pragma pop_macro("opfx") +#endif // ^^^ defined(_CRTBLD) ^^^ void __CLR_OR_THIS_CALL _Osfx() noexcept { // perform any wrapup _TRY_BEGIN diff --git a/stl/inc/istream b/stl/inc/istream index 9a931500047..49380d7246e 100644 --- a/stl/inc/istream +++ b/stl/inc/istream @@ -155,20 +155,16 @@ public: return this->good(); } -#pragma push_macro("ipfx") -#pragma push_macro("isfx") -#undef ipfx -#undef isfx +#ifdef _CRTBLD // TRANSITION, ABI: non-Standard ipfx() is preserved for binary compatibility - _DEPRECATE_IO_PFX_SFX bool __CLR_OR_THIS_CALL ipfx(bool _Noskip = false) { + bool __CLR_OR_THIS_CALL ipfx(bool _Noskip = false) { // test stream state and skip whitespace as needed return _Ipfx(_Noskip); } // TRANSITION, ABI: non-Standard isfx() is preserved for binary compatibility - _DEPRECATE_IO_PFX_SFX void __CLR_OR_THIS_CALL isfx() {} // perform any wrapup -#pragma pop_macro("isfx") -#pragma pop_macro("ipfx") + void __CLR_OR_THIS_CALL isfx() {} // perform any wrapup +#endif // ^^^ defined(_CRTBLD) ^^^ #ifdef _M_CEE_PURE basic_istream& __CLR_OR_THIS_CALL operator>>(basic_istream&(__clrcall* _Pfn)(basic_istream&) ) { diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 0ccf71729ed..302f5d9b79e 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1477,16 +1477,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect // STL4044 was "The contents of the stdext::cvt namespace are non-Standard extensions and will be removed" -#if !defined(_SILENCE_IO_PFX_SFX_DEPRECATION_WARNING) && !defined(_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS) -#define _DEPRECATE_IO_PFX_SFX \ - [[deprecated( \ - "warning STL4045: The ipfx(), isfx(), opfx(), and osfx() functions are removed before C++98 (see WG21-N0794) " \ - "but kept as non-Standard extensions. They will be removed in the future, and the member classes sentry " \ - "should be used instead. You can define _SILENCE_IO_PFX_SFX_DEPRECATION_WARNING or " \ - "_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]] -#else // ^^^ warning enabled / warning disabled vvv -#define _DEPRECATE_IO_PFX_SFX -#endif // ^^^ warning disabled ^^^ +// STL4045 was "The ipfx(), isfx(), opfx(), and osfx() functions are [...] non-Standard extensions" // STL4046 was "Non-Standard TR1 components in are deprecated and will be REMOVED." diff --git a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp index eadd271f797..a817f67417a 100644 --- a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp +++ b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp @@ -21,15 +21,14 @@ #define make_unchecked_array_iterator delete #define unchecked_array_iterator delete +#define ipfx delete +#define isfx delete +#define opfx delete +#define osfx delete + // Test workaround for extensions of non-reserved names that can't be removed at this moment. #define raw_name 1001 -#define ipfx 1002 -#define isfx 1003 - -#define opfx 1004 -#define osfx 1005 - // Also test GH-2645: : Conformance issue on [[msvc::known_semantics]] #define msvc 1 #define known_semantics 2 @@ -72,19 +71,3 @@ #if raw_name != 1001 #error bad macro expansion #endif // raw_name != 1001 - -#if ipfx != 1002 -#error bad macro expansion -#endif // ipfx != 1002 - -#if isfx != 1003 -#error bad macro expansion -#endif // isfx != 1003 - -#if opfx != 1004 -#error bad macro expansion -#endif // opfx != 1004 - -#if osfx != 1005 -#error bad macro expansion -#endif // osfx != 1005 From ebfcbc8af7b525765122ab4afe6b80094ea12a3d Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sat, 8 Nov 2025 08:36:03 -0800 Subject: [PATCH 2/2] Remove locale::empty(). --- stl/inc/xlocale | 6 ++++-- stl/inc/yvals_core.h | 10 +--------- stl/src/locale0.cpp | 3 +-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/stl/inc/xlocale b/stl/inc/xlocale index f5664e7ba5e..0409a1aa0d4 100644 --- a/stl/inc/xlocale +++ b/stl/inc/xlocale @@ -400,8 +400,10 @@ public: static _MRTIMP2_PURE locale __CLRCALL_PURE_OR_CDECL global(const locale&); // current locale - // TRANSITION, ABI: non-Standard empty() is preserved for binary compatibility - _DEPRECATE_LOCALE_EMPTY static _MRTIMP2_PURE locale __CLRCALL_PURE_OR_CDECL empty(); // empty (transparent) locale +#ifdef _CRTBLD + // TRANSITION, ABI: non-Standard locale::empty() is preserved for binary compatibility + static _MRTIMP2_PURE locale __CLRCALL_PURE_OR_CDECL empty(); +#endif // ^^^ defined(_CRTBLD) ^^^ private: struct _Secret_locale_construct_tag { diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 302f5d9b79e..d8f8708946e 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1493,15 +1493,7 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define _CXX20_DEPRECATE_CODECVT_CHAR8_T_FACETS #endif // ^^^ warning disabled ^^^ -#if !defined(_SILENCE_LOCALE_EMPTY_DEPRECATION_WARNING) && !defined(_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS) -#define _DEPRECATE_LOCALE_EMPTY \ - [[deprecated( \ - "warning STL4048: locale::empty() is a non-Standard extension and will be removed in the future. A " \ - "default-constructed locale can be used instead. You can define _SILENCE_LOCALE_EMPTY_DEPRECATION_WARNING or " \ - "_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]] -#else // ^^^ warning enabled / warning disabled vvv -#define _DEPRECATE_LOCALE_EMPTY -#endif // ^^^ warning disabled ^^^ +// STL4048 was "locale::empty() is a non-Standard extension and will be removed in the future." // next warning number: STL4049 diff --git a/stl/src/locale0.cpp b/stl/src/locale0.cpp index 81aae0ad22e..aa6f794a47f 100644 --- a/stl/src/locale0.cpp +++ b/stl/src/locale0.cpp @@ -9,8 +9,6 @@ #undef _ENFORCE_ONLY_CORE_HEADERS // TRANSITION, should be a core header -#define _SILENCE_LOCALE_EMPTY_DEPRECATION_WARNING - #include #include #include @@ -157,6 +155,7 @@ _MRTIMP2_PURE const locale& __CLRCALL_PURE_OR_CDECL locale::classic() { // get r return classic_locale; } +// TRANSITION, ABI: non-Standard locale::empty() is preserved for binary compatibility _MRTIMP2_PURE locale __CLRCALL_PURE_OR_CDECL locale::empty() { // make empty transparent locale _Init(); return locale{_Secret_locale_construct_tag{}, _Locimp::_New_Locimp(true)};