[libcxx-commits] [libcxx] [libc++] Undprecated POSIX STREAM macros. (PR #88296)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 10 09:51:14 PDT 2024
https://github.com/mordante created https://github.com/llvm/llvm-project/pull/88296
LWG3869 Deprecate std::errc constants related to UNIX STREAMS
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.
>From e5ea2f50bc0a1d76a60253558572f77dfbd597cf Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Wed, 10 Apr 2024 18:48:36 +0200
Subject: [PATCH] [libc++] Undprecated POSIX STREAM macros.
LWG3869 Deprecate std::errc constants related to UNIX STREAMS
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.
---
libcxx/include/__system_error/errc.h | 5 +++
libcxx/include/cerrno | 18 +++------
.../test/std/depr.cerro/cerrno.syn.verify.cpp | 37 -------------------
3 files changed, 11 insertions(+), 49 deletions(-)
delete mode 100644 libcxx/test/std/depr.cerro/cerrno.syn.verify.cpp
diff --git a/libcxx/include/__system_error/errc.h b/libcxx/include/__system_error/errc.h
index e9f3656b7b9c2b..a262c856fd998f 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 my start to deprecate these POSIX macros the
+// disabling of the deprecated macros is not removed.
#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 6171ae31f18479..81e82cf849ab00 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
+//
+// 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 3a38605570dafb..00000000000000
--- 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
-
-// <cerrno>
-
-// 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 <cerrno>
-
-#ifdef ENODATA
-[[maybe_unused]] int nodata =
- ENODATA; // expected-warning at cerrno.syn.verify.cpp:* 2 {{macro 'ENODATA' has been marked as deprecated}}
-#endif
-#ifdef ENOSR
-[[maybe_unused]] int nosr =
- ENOSR; // expected-warning at cerrno.syn.verify.cpp:* 2 {{macro 'ENOSR' has been marked as deprecated}}
-#endif
-#ifdef ENOSTR
-[[maybe_unused]] int nostr =
- ENOSTR; // expected-warning at cerrno.syn.verify.cpp:* 2 {{macro 'ENOSTR' has been marked as deprecated}}
-#endif
-#ifdef ETIME
-[[maybe_unused]] int timeout =
- ETIME; // expected-warning at cerrno.syn.verify.cpp:* 2 {{macro 'ETIME' has been marked as deprecated}}
-#endif
More information about the libcxx-commits
mailing list