summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental/any
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/any
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/any')
-rw-r--r--libcxx/include/experimental/any18
1 files changed, 14 insertions, 4 deletions
diff --git a/libcxx/include/experimental/any b/libcxx/include/experimental/any
index 1dcdd0f25ec..d9c95342589 100644
--- a/libcxx/include/experimental/any
+++ b/libcxx/include/experimental/any
@@ -1,11 +1,21 @@
// -*- C++ -*-
-//===------------------------------ any -----------------------------------===//
+//===------------------------------- any ----------------------------------===//
//
// The LLVM Compiler Infrastructure
//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_ANY
+#define _LIBCPP_EXPERIMENTAL_ANY
-#error "<experimental/any> has been removed. Use <any> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/any> has been removed. Use <any> instead.")
+#else
+# warning "<experimental/any> has been removed. Use <any> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_ANY
OpenPOWER on IntegriCloud