[libcxx-commits] [PATCH] D102992: [libcxx][type_traits] remove `std::is_literal_type` and `std::result_of` for C++20
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jun 11 08:52:13 PDT 2021
Quuxplusone added inline comments.
================
Comment at: libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of.deprecated.fail.cpp:25-26
+int main(int, char**) {
+ typedef std::result_of< // expected-warning {{'result_of<CallableStruct (int)>' is deprecated}}
+ CallableStruct(int)>::type f;
}
----------------
cjdb wrote:
> ldionne wrote:
> > Why not write this as:
> >
> > ```
> > typedef std::result_of<CallableStruct(int)>::type f; // expected-warning {{'result_of<CallableStruct (int)>' is deprecated}}
> > ```
> >
> > Unless there is a reason for the funky indentation?
> clang-format doesn't like that (I suspect the line is longer than 120 chars). I do this instead:
>
> ```
> typedef std::result_of<CallableStruct(int)>::type f;
> // expected-warning at -1{{'result_of<CallableStruct (int)>' is deprecated}}
> ```
Another way of writing this test is as a two-liner:
```
std::result_of<int(*())()> a; // expected-warning{{is deprecated}}
std::result_of_t<int(*())()> b; // expected-warning{{is deprecated}}
```
(and then don't even provide a `main` because this test is compile-only).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102992/new/
https://reviews.llvm.org/D102992
More information about the libcxx-commits
mailing list