-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Deprecate extension
packaged_task::result_type
This extension is questionable and non-conforming. Perhaps we should deprecate and then remove it.
- Loading branch information
1 parent
ab9a80a
commit da7895d
Showing
4 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
libcxx/test/libcxx/thread/futures/futures.task/type.depr.verify.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// UNSUPPORTED: no-threads | ||
// UNSUPPORTED: c++03 | ||
|
||
// <future> | ||
|
||
// template<class R, class... ArgTypes> | ||
// class packaged_task<R(ArgTypes...)> | ||
// { | ||
// public: | ||
// typedef R result_type; // extension | ||
|
||
// This libc++ extension is deprecated. See https://github.com/llvm/llvm-project/issues/112856. | ||
|
||
#include <future> | ||
#include <type_traits> | ||
|
||
struct A {}; | ||
|
||
using RA = std::packaged_task<A(int, char)>::result_type; // expected-warning {{'result_type' is deprecated}} | ||
using RV = std::packaged_task<void(int, char)>::result_type; // expected-warning {{'result_type' is deprecated}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters