diff --git a/libcxx/include/__system_error/errc.h b/libcxx/include/__system_error/errc.h index e9f3656b7b9c2..0004c46e2279b 100644 --- a/libcxx/include/__system_error/errc.h +++ b/libcxx/include/__system_error/errc.h @@ -112,6 +112,11 @@ enum class errc // macros. So GCC does not need the pushing and popping. // // TODO Remove this when the deprecated constants are removed. +// +// Note based on the post-review comments in +// https://github.com/llvm/llvm-project/pull/80542 libc++ no longer deprecates +// the macros. Since C libraries may start to deprecate these POSIX macros the +// deprecation warning avoidance is kept. #if defined(_LIBCPP_COMPILER_CLANG_BASED) # define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_PUSH _LIBCPP_SUPPRESS_DEPRECATED_PUSH # define _LIBCPP_SUPPRESS_DEPRECATED_ERRC_POP _LIBCPP_SUPPRESS_DEPRECATED_POP diff --git a/libcxx/include/cerrno b/libcxx/include/cerrno index 6171ae31f1847..f1295680fed6c 100644 --- a/libcxx/include/cerrno +++ b/libcxx/include/cerrno @@ -38,17 +38,11 @@ Macros: # pragma GCC system_header #endif -#ifdef ENODATA -# pragma clang deprecated(ENODATA, "ENODATA is deprecated in ISO C++") -#endif -#ifdef ENOSR -# pragma clang deprecated(ENOSR, "ENOSR is deprecated in ISO C++") -#endif -#ifdef ENOSTR -# pragma clang deprecated(ENOSTR, "ENOSTR is deprecated in ISO C++") -#endif -#ifdef ETIME -# pragma clang deprecated(ETIME, "ETIME is deprecated in ISO C++") -#endif +// LWG3869 Deprecate std::errc constants related to UNIX STREAMS +// +// This LWG issue deprecates the POSIX macros ENODATA, ENOSR, ENOSTR, and ETIME. These were +// deprecated in libc++ in https://github.com/llvm/llvm-project/pull/80542. +// Based on the post commit feedback the macro are no longer deprecated. +// Instead libc++ leaves the deprecation to the provider of errno.h. #endif // _LIBCPP_CERRNO diff --git a/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp b/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp deleted file mode 100644 index 3a38605570daf..0000000000000 --- a/libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: clang-modules-build -// UNSUPPORTED: apple-clang && c++03 - -// - -// tests LWG 3869 deprecated macros. -// -// Note the macros may not be defined. When they are not defined the -// ifdef XXX does not trigger a deprecated message. So use them in the -// ifdef and test for 2 deprecated messages. - -#include - -#ifdef ENODATA -[[maybe_unused]] int nodata = - ENODATA; // expected-warning@cerrno.syn.verify.cpp:* 2 {{macro 'ENODATA' has been marked as deprecated}} -#endif -#ifdef ENOSR -[[maybe_unused]] int nosr = - ENOSR; // expected-warning@cerrno.syn.verify.cpp:* 2 {{macro 'ENOSR' has been marked as deprecated}} -#endif -#ifdef ENOSTR -[[maybe_unused]] int nostr = - ENOSTR; // expected-warning@cerrno.syn.verify.cpp:* 2 {{macro 'ENOSTR' has been marked as deprecated}} -#endif -#ifdef ETIME -[[maybe_unused]] int timeout = - ETIME; // expected-warning@cerrno.syn.verify.cpp:* 2 {{macro 'ETIME' has been marked as deprecated}} -#endif