[libcxx-commits] [PATCH] D129716: [libc++][NFC] Use is_void instead of is_same<void, ...>

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 17 11:23:26 PDT 2022


philnik added a comment.

In D129716#3655911 <https://reviews.llvm.org/D129716#3655911>, @Mordante wrote:

> Can you explain what the benefit of this change is? And why the different behaviour of `std::same_as` and `std::is_void_v` is not an issue. I'm not even sure we should call this an NFC patch.
>
> In general it would be good to add this kind of information to the commit message/review description.

The benefit is that it's a bit easier to read IMO. The different behaviour isn't an issue in the first three files, because it just checks that `__make_32_64_or_128_bit_t` or the conditional succeeded, which indicate a failure as `void`. The two tests check that the return type is void. There it isn't a problem, because cv-qualifiers on return types are discarded. IOW `const void func(); static_assert(std::is_same_v<void, decltype(func())>);` is a correct program.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129716/new/

https://reviews.llvm.org/D129716



More information about the libcxx-commits mailing list