[libcxx-commits] [PATCH] D97283: [libcxx][type_traits] is_unsigned is false for enum types

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 15 17:24:26 PDT 2021

Quuxplusone added inline comments.

Comment at: libcxx/include/type_traits:1454
-#if __has_keyword(__is_unsigned)
+// Before clang 13 __is_unsigned returned true for enums with signed underlying type
+#if __has_keyword(__is_unsigned) &&                                            \
zoecarver wrote:
> With other builtins that have had issues in earlier versions of Clang, such as `__is_pointer`,  we simply disable the fast path before Clang XX. I think we should do that here too. For the most part, the people who care about this type of performance are using ToT. Also, this will greatly reduce the complexity here, so we don't add any more branches to the already complicated implementation. WDYT?
FWIW, I don't object to that idea at all.

Comment at: libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_signed.pass.cpp:58
+class NotEmpty {
+  virtual ~NotEmpty();
zoecarver wrote:
> I know this wasn't you, but I really don't like the name `NotEmpty`. Maybe call this `VirtualDestructor` or something. 
This type is cut-and-pasted all over the place, so please change it everywhere (which means change it in a separate PR) or not at all.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list