[libcxx] r350485 - Fix PR39749 - Headers containing just #error harm __has_include.

Eric Fiselier eric at efcs.ca
Sat Jan 5 16:37:32 PST 2019


Author: ericwf
Date: Sat Jan  5 16:37:31 2019
New Revision: 350485

URL: http://llvm.org/viewvc/llvm-project?rev=350485&view=rev
Log:
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.

Added:
    libcxx/trunk/test/libcxx/experimental/diagnostics/
    libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/
    libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/use_header_warning.fail.cpp
    libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/numerics/
    libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/
    libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/strings/
    libcxx/trunk/test/libcxx/experimental/strings/string.view/
    libcxx/trunk/test/libcxx/experimental/strings/string.view/use_header_warning.fail.cpp
    libcxx/trunk/test/libcxx/experimental/strings/string.view/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/any/
    libcxx/trunk/test/libcxx/experimental/utilities/any/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/any/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/optional/
    libcxx/trunk/test/libcxx/experimental/utilities/optional/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/optional/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/ratio/
    libcxx/trunk/test/libcxx/experimental/utilities/ratio/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/ratio/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/time/
    libcxx/trunk/test/libcxx/experimental/utilities/time/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/time/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/tuple/
    libcxx/trunk/test/libcxx/experimental/utilities/tuple/use_header_warning.fail.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
    libcxx/trunk/test/libcxx/experimental/utilities/tuple/version.pass.cpp
      - copied, changed from r350478, libcxx/trunk/include/experimental/tuple
Modified:
    libcxx/trunk/include/experimental/any
    libcxx/trunk/include/experimental/chrono
    libcxx/trunk/include/experimental/numeric
    libcxx/trunk/include/experimental/optional
    libcxx/trunk/include/experimental/ratio
    libcxx/trunk/include/experimental/string_view
    libcxx/trunk/include/experimental/system_error
    libcxx/trunk/include/experimental/tuple

Modified: libcxx/trunk/include/experimental/any
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/any?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/any (original)
+++ libcxx/trunk/include/experimental/any Sat Jan  5 16:37:31 2019
@@ -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

Modified: libcxx/trunk/include/experimental/chrono
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/chrono?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/chrono (original)
+++ libcxx/trunk/include/experimental/chrono Sat Jan  5 16:37:31 2019
@@ -1,11 +1,21 @@
 // -*- C++ -*-
-//===------------------------------ chrono ---------------------------------===//
+//===---------------------------- chrono ----------------------------------===//
 //
 //                     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_CHRONO
+#define _LIBCPP_EXPERIMENTAL_CHRONO
 
-#error "<experimental/chrono> has been removed. Use <chrono> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/chrono> has been removed. Use <chrono> instead.")
+#else
+# warning "<experimental/chrono> has been removed. Use <chrono> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_CHRONO

Modified: libcxx/trunk/include/experimental/numeric
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/numeric?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/numeric (original)
+++ libcxx/trunk/include/experimental/numeric Sat Jan  5 16:37:31 2019
@@ -7,5 +7,15 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_NUMERIC
+#define _LIBCPP_EXPERIMENTAL_NUMERIC
 
-#error "<experimental/numeric> has been removed. Use <numeric> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/numeric> has been removed. Use <numeric> instead.")
+#else
+# warning "<experimental/numeric> has been removed. Use <numeric> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_NUMERIC

Modified: libcxx/trunk/include/experimental/optional
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/optional?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/optional (original)
+++ libcxx/trunk/include/experimental/optional Sat Jan  5 16:37:31 2019
@@ -7,5 +7,15 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_OPTIONAL
+#define _LIBCPP_EXPERIMENTAL_OPTIONAL
 
-#error "<experimental/optional> has been removed. Use <optional> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/optional> has been removed. Use <optional> instead.")
+#else
+# warning "<experimental/optional> has been removed. Use <optional> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_OPTIONAL

Modified: libcxx/trunk/include/experimental/ratio
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/ratio?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/ratio (original)
+++ libcxx/trunk/include/experimental/ratio Sat Jan  5 16:37:31 2019
@@ -1,11 +1,21 @@
 // -*- C++ -*-
-//===------------------------------ ratio ---------------------------------===//
+//===----------------------------- ratio ----------------------------------===//
 //
 //                     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_RATIO
+#define _LIBCPP_EXPERIMENTAL_RATIO
 
-#error "<experimental/ratio> has been removed. Use <ratio> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/ratio> has been removed. Use <ratio> instead.")
+#else
+# warning "<experimental/ratio> has been removed. Use <ratio> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_RATIO

Modified: libcxx/trunk/include/experimental/string_view
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/string_view?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/string_view (original)
+++ libcxx/trunk/include/experimental/string_view Sat Jan  5 16:37:31 2019
@@ -3,9 +3,19 @@
 //
 //                     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_STRING_VIEW
+#define _LIBCPP_EXPERIMENTAL_STRING_VIEW
 
-#error "<experimental/string_view> has been removed. Use <string_view> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/string_view> has been removed. Use <string_view> instead.")
+#else
+# warning "<experimental/string_view> has been removed. Use <string_view> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_STRING_VIEW

Modified: libcxx/trunk/include/experimental/system_error
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/system_error?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/system_error (original)
+++ libcxx/trunk/include/experimental/system_error Sat Jan  5 16:37:31 2019
@@ -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

Modified: libcxx/trunk/include/experimental/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/tuple?rev=350485&r1=350484&r2=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/include/experimental/tuple Sat Jan  5 16:37:31 2019
@@ -7,5 +7,15 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+#ifndef _LIBCPP_EXPERIMENTAL_TUPLE
+#define _LIBCPP_EXPERIMENTAL_TUPLE
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+#include <__config>
+
+#ifdef _LIBCPP_WARNING
+_LIBCPP_WARNING("<experimental/tuple> has been removed. Use <tuple> instead.")
+#else
+# warning "<experimental/tuple> has been removed. Use <tuple> instead."
+#endif
+
+#endif // _LIBCPP_EXPERIMENTAL_TUPLE

Added: libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/use_header_warning.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/use_header_warning.fail.cpp?rev=350485&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/use_header_warning.fail.cpp (added)
+++ libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: verify-support
+
+// <experimental/system_error>
+
+#include <experimental/system_error>
+
+// expected-error at experimental/system_error:* {{"<experimental/system_error> has been removed. Use <system_error> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/diagnostics/syserr/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/system_error>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/system_error>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/numeric>
+
+#include <experimental/numeric>
+
+// expected-error at experimental/numeric:* {{"<experimental/numeric> has been removed. Use <numeric> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/numerics/numeric.ops/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/numeric>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/numeric>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Added: libcxx/trunk/test/libcxx/experimental/strings/string.view/use_header_warning.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/strings/string.view/use_header_warning.fail.cpp?rev=350485&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/experimental/strings/string.view/use_header_warning.fail.cpp (added)
+++ libcxx/trunk/test/libcxx/experimental/strings/string.view/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -0,0 +1,18 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: verify-support
+
+// <experimental/string_view>
+
+#include <experimental/string_view>
+
+// expected-error at experimental/string_view:* {{"<experimental/string_view> has been removed. Use <string_view> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/strings/string.view/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/strings/string.view/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/strings/string.view/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/strings/string.view/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/string_view>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/string_view>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/any/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/any/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/any/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/any/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/any>
+
+#include <experimental/any>
+
+// expected-error at experimental/any:* {{"<experimental/any> has been removed. Use <any> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/any/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/any/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/any/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/any/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/any>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/any>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/optional/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/optional/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/optional/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/optional/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/optional>
+
+#include <experimental/optional>
+
+// expected-error at experimental/optional:* {{"<experimental/optional> has been removed. Use <optional> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/optional/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/optional/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/optional/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/optional/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/optional>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/optional>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/ratio/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/ratio/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/ratio/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/ratio/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/ratio>
+
+#include <experimental/ratio>
+
+// expected-error at experimental/ratio:* {{"<experimental/ratio> has been removed. Use <ratio> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/ratio/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/ratio/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/ratio/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/ratio/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/ratio>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/ratio>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/time/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/time/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/time/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/time/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/chrono>
+
+#include <experimental/chrono>
+
+// expected-error at experimental/chrono:* {{"<experimental/chrono> has been removed. Use <chrono> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/time/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/time/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/time/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/time/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/chrono>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/chrono>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/tuple/use_header_warning.fail.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/tuple/use_header_warning.fail.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/tuple/use_header_warning.fail.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/tuple/use_header_warning.fail.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// REQUIRES: verify-support
+
+// <experimental/tuple>
+
+#include <experimental/tuple>
+
+// expected-error at experimental/tuple:* {{"<experimental/tuple> has been removed. Use <tuple> instead."}}
+
+int main() {}

Copied: libcxx/trunk/test/libcxx/experimental/utilities/tuple/version.pass.cpp (from r350478, libcxx/trunk/include/experimental/tuple)
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/experimental/utilities/tuple/version.pass.cpp?p2=libcxx/trunk/test/libcxx/experimental/utilities/tuple/version.pass.cpp&p1=libcxx/trunk/include/experimental/tuple&r1=350478&r2=350485&rev=350485&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/tuple (original)
+++ libcxx/trunk/test/libcxx/experimental/utilities/tuple/version.pass.cpp Sat Jan  5 16:37:31 2019
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//===----------------------------- tuple ----------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,4 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#error "<experimental/tuple> has been removed. Use <tuple> instead."
+// <experimental/tuple>
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-W#warnings"
+#endif
+#include <experimental/tuple>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main() {}




More information about the libcxx-commits mailing list