Skip to content

Commit

Permalink
[libcxx] Slightly improved policy for handling experimental features
Browse files Browse the repository at this point in the history
Summary:
Following the discussion on the libcxx-dev mailing list
(http://lists.llvm.org/pipermail/libcxx-dev/2019-May/000358.html),
this implements the new policy for handling experimental features and
their deprecation. We basically add a deprecation warning for
std::experimental::filesystem, and we remove a bunch of <experimental/*>
headers that were now empty.

Reviewers: mclow.lists, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, arphaman, libcxx-commits, jfb

Tags: #libc

Differential Revision: https://reviews.llvm.org/D62428

llvm-svn: 363072
  • Loading branch information
ldionne committed Jun 11, 2019
1 parent 10ed681 commit 776acf2
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 697 deletions.
203 changes: 203 additions & 0 deletions libcxx/docs/DesignDocs/ExperimentalFeatures.rst

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions libcxx/docs/UsingLibcxx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ page.
* The contents of the ``<experimental/...>`` headers and ``libc++experimental.a``
library will not remain compatible between versions.
* No guarantees of API or ABI stability are provided.
* When we implement the standardized version of an experimental feature,
the experimental feature is removed two releases after the non-experimental
version has shipped. The full policy is explained :ref:`here <experimental features>`.

Using libc++ on Linux
=====================
Expand Down
1 change: 1 addition & 0 deletions libcxx/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Design Documents
DesignDocs/DebugMode
DesignDocs/CapturingConfigInfo
DesignDocs/ABIVersioning
DesignDocs/ExperimentalFeatures
DesignDocs/VisibilityMacros
DesignDocs/ThreadingSupportAPI
DesignDocs/FileTimeType
Expand Down
8 changes: 0 additions & 8 deletions libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ set(files
experimental/__config
experimental/__memory
experimental/algorithm
experimental/any
experimental/chrono
experimental/coroutine
experimental/deque
experimental/filesystem
Expand All @@ -76,17 +74,11 @@ set(files
experimental/list
experimental/map
experimental/memory_resource
experimental/numeric
experimental/optional
experimental/propagate_const
experimental/ratio
experimental/regex
experimental/set
experimental/simd
experimental/string
experimental/string_view
experimental/system_error
experimental/tuple
experimental/type_traits
experimental/unordered_map
experimental/unordered_set
Expand Down
8 changes: 7 additions & 1 deletion libcxx/include/experimental/__config
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,14 @@
namespace chrono { namespace experimental { inline namespace fundamentals_v1 {
#define _LIBCPP_END_NAMESPACE_CHRONO_LFTS _LIBCPP_END_NAMESPACE_STD } } }

#if defined(_LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM)
# define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM /* nothing */
#else
# define _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM __attribute__((deprecated("std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.")))
#endif

#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem { \
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace filesystem _LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM { \
inline namespace v1 {

#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
Expand Down
20 changes: 0 additions & 20 deletions libcxx/include/experimental/any

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/chrono

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/numeric

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/optional

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/ratio

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/string_view

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/system_error

This file was deleted.

20 changes: 0 additions & 20 deletions libcxx/include/experimental/tuple

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 20 additions & 0 deletions libcxx/test/libcxx/experimental/filesystem/deprecated.fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

// REQUIRES: verify-support
// UNSUPPORTED: c++98, c++03

// <experimental/filesystem>

#include <experimental/filesystem>

using namespace std::experimental::filesystem; // expected-error {{'filesystem' is deprecated: std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.}}

int main(int, char**) {
return 0;
}
2 changes: 2 additions & 0 deletions libcxx/test/libcxx/experimental/filesystem/version.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

// <experimental/filesystem>

#define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM

#include <experimental/filesystem>

#include "test_macros.h"
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 776acf2

Please sign in to comment.