Skip to content
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

<istream>, <ostream>: Deprecate pre-Standard ipfx, isfx, opfx, and osfx functions #4006

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions stl/inc/istream
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ public:
}

// TRANSITION, ABI: non-Standard ipfx() is preserved for binary compatibility
bool __CLR_OR_THIS_CALL ipfx(bool _Noskip = false) { // test stream state and skip whitespace as needed
_DEPRECATE_IO_PFX_SFX 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
void __CLR_OR_THIS_CALL isfx() {} // perform any wrapup
_DEPRECATE_IO_PFX_SFX void __CLR_OR_THIS_CALL isfx() {} // perform any wrapup

#ifdef _M_CEE_PURE
basic_istream& __CLR_OR_THIS_CALL operator>>(basic_istream&(__clrcall* _Pfn)(basic_istream&) ) {
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/ostream
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public:
};

// TRANSITION, ABI: non-Standard opfx() is preserved for binary compatibility
bool __CLR_OR_THIS_CALL opfx() { // test stream state and flush tie stream as needed
_DEPRECATE_IO_PFX_SFX bool __CLR_OR_THIS_CALL opfx() { // test stream state and flush tie stream as needed
if (!this->good()) {
return false;
}
Expand All @@ -152,7 +152,7 @@ public:
}

// TRANSITION, ABI: non-Standard osfx() is preserved for binary compatibility
void __CLR_OR_THIS_CALL osfx() noexcept { // perform any wrapup
_DEPRECATE_IO_PFX_SFX void __CLR_OR_THIS_CALL osfx() noexcept { // perform any wrapup
_Osfx();
}

Expand Down
14 changes: 13 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,19 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect
#define _DEPRECATE_STDEXT_CVT
#endif // ^^^ warning disabled ^^^

// next warning number: STL4045
#if _HAS_CXX17 && !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 instread. You can define _SILENCE_IO_PFX_SFX_DEPRECATION_WARNING or " \
frederick-vs-ja marked this conversation as resolved.
Show resolved Hide resolved
"_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]]
#else // ^^^ warning enabled / warning disabled vvv
#define _DEPRECATE_IO_PFX_SFX
#endif // ^^^ warning disabled ^^^

// next warning number: STL4046

// next error number: STL1006

Expand Down