[libcxx-commits] [PATCH] D102328: [libc++] Fix constraint for [bit.pow.two] functions

Jonathan Wakely via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 12 07:23:10 PDT 2021


jwakely created this revision.
jwakely added reviewers: mclow.lists, ldionne.
jwakely requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Fixes https://bugs.llvm.org/show_bug.cgi?id=49450

There's no need to exclude `signed char`, because `is_unsigned<_Tp>` already did that. But you do need to exclude plain `char`, because `is_integral<char>` is true and `is_unsigned<char>` is sometimes true, but `char` is not an unsigned integer type.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102328

Files:
  libcxx/include/bit


Index: libcxx/include/bit
===================================================================
--- libcxx/include/bit
+++ libcxx/include/bit
@@ -83,7 +83,7 @@
          is_integral<_Tp>::value &&
          is_unsigned<_Tp>::value &&
         _IsNotSame<typename remove_cv<_Tp>::type, bool>::value &&
-        _IsNotSame<typename remove_cv<_Tp>::type, signed char>::value &&
+        _IsNotSame<typename remove_cv<_Tp>::type, char>::value &&
         _IsNotSame<typename remove_cv<_Tp>::type, wchar_t>::value &&
         _IsNotSame<typename remove_cv<_Tp>::type, char16_t>::value &&
         _IsNotSame<typename remove_cv<_Tp>::type, char32_t>::value


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102328.344817.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210512/c2b51869/attachment-0001.bin>


More information about the libcxx-commits mailing list