Skip to content

Commit 8b171a0

Browse files
[libc++] Remove the packaged_task::result_type extension (#147671)
No escape hatch added, as there doesn't seem anyone critically relying on this.
1 parent 2137354 commit 8b171a0

File tree

4 files changed

+5
-53
lines changed

4 files changed

+5
-53
lines changed

libcxx/docs/ReleaseNotes/21.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Deprecations and Removals
100100
- libc++ no longer adds ``constexpr`` to ``std::hash<std::vector<bool, A>>::operator()``, as the ``constexpr`` addition
101101
since C++20 was an unintended extension.
102102

103-
- TODO: The non-conforming extension ``packaged_task::result_type`` has been removed in LLVM 21.
103+
- The non-conforming extension ``packaged_task::result_type`` has been removed in LLVM 21.
104104

105105
Potentially breaking changes
106106
----------------------------

libcxx/include/future

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,6 @@ template <class R, class... ArgTypes>
322322
class packaged_task<R(ArgTypes...)>
323323
{
324324
public:
325-
typedef R result_type; // extension
326-
327325
// construction and destruction
328326
packaged_task() noexcept;
329327
template <class F>
@@ -1605,9 +1603,6 @@ inline _Rp __packaged_task_function<_Rp(_ArgTypes...)>::operator()(_ArgTypes...
16051603

16061604
template <class _Rp, class... _ArgTypes>
16071605
class packaged_task<_Rp(_ArgTypes...)> {
1608-
public:
1609-
using result_type _LIBCPP_DEPRECATED = _Rp; // extension
1610-
16111606
private:
16121607
__packaged_task_function<_Rp(_ArgTypes...)> __f_;
16131608
promise<_Rp> __p_;
@@ -1699,9 +1694,6 @@ void packaged_task<_Rp(_ArgTypes...)>::reset() {
16991694

17001695
template <class... _ArgTypes>
17011696
class packaged_task<void(_ArgTypes...)> {
1702-
public:
1703-
using result_type _LIBCPP_DEPRECATED = void; // extension
1704-
17051697
private:
17061698
__packaged_task_function<void(_ArgTypes...)> __f_;
17071699
promise<void> __p_;

libcxx/test/libcxx/thread/futures/futures.task/types.pass.cpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

libcxx/test/libcxx/thread/futures/futures.task/type.depr.verify.cpp renamed to libcxx/test/std/thread/futures/futures.task/futures.task.members/type.verify.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,12 @@
1111

1212
// <future>
1313

14-
// template<class R, class... ArgTypes>
15-
// class packaged_task<R(ArgTypes...)>
16-
// {
17-
// public:
18-
// typedef R result_type; // extension
19-
20-
// This libc++ extension is deprecated. See https://github.com/llvm/llvm-project/issues/112856.
14+
// Verify that the non-conforming extension packaged_task::result_type is removed.
15+
// See https://github.com/llvm/llvm-project/issues/112856.
2116

2217
#include <future>
23-
#include <type_traits>
2418

2519
struct A {};
2620

27-
using RA = std::packaged_task<A(int, char)>::result_type; // expected-warning {{'result_type' is deprecated}}
28-
using RV = std::packaged_task<void(int, char)>::result_type; // expected-warning {{'result_type' is deprecated}}
21+
using RA = std::packaged_task<A(int, char)>::result_type; // expected-error {{no type named 'result_type'}}
22+
using RV = std::packaged_task<void(int, char)>::result_type; // expected-error {{no type named 'result_type'}}

0 commit comments

Comments
 (0)