summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental/system_error
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-01-06 00:37:31 +0000
committerEric Fiselier <eric@efcs.ca>2019-01-06 00:37:31 +0000
commitb168a7c6604857e507c7da90cdb7c2bc683adf2e (patch)
treeedbd4ed7da70cfbb164e95cffbd348a27243cac5 /libcxx/include/experimental/system_error
parent9dabf6ac70dafbdcbfbc3b6401de92731897e958 (diff)
downloadbcm5719-llvm-b168a7c6604857e507c7da90cdb7c2bc683adf2e.tar.gz
bcm5719-llvm-b168a7c6604857e507c7da90cdb7c2bc683adf2e.zip
Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of is harmful to common feature detection idioms. We should also consider only emitting the warning when __DEPRECATED is defined, like we do in the <ext/foo> headers. Users may want to specify "-Werror=-W#warnings" while still ignoring the libc++ warnings. llvm-svn: 350485
Diffstat (limited to 'libcxx/include/experimental/system_error')
-rw-r--r--libcxx/include/experimental/system_error12
1 files changed, 11 insertions, 1 deletions
diff --git a/libcxx/include/experimental/system_error b/libcxx/include/experimental/system_error
index 7937357fa14..1cf84ee0125 100644
--- a/libcxx/include/experimental/system_error
+++ b/libcxx/include/experimental/system_error
@@ -7,5 +7,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR
+#define _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR
-#error "<experimental/system_error> has been removed. Use <system_error> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/system_error> has been removed. Use <system_error> instead.")
+#else
+# warning "<experimental/system_error> has been removed. Use <system_error> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_SYSTEM_ERROR
OpenPOWER on IntegriCloud