Quuxplusone added a comment.

🎉



================
Comment at: clang/lib/Sema/SemaExprCXX.cpp:4837
+    // Enum types should always return false (same as UTT_IsSigned).
+    return !T->isEnumeralType() && T->isUnsignedIntegerType();
 
----------------
FWIW, I'd lose the parenthetical comment, and I'd write the conditions as 
respectively

    return T->isUnsignedIntegerType() && !T->isEnumeralType();

    return T->isFloatingType() || (T->isSignedIntegerType() && 
!T->isEnumeralType());

both because "T not being an enum type" is expected to be usually true, and 
because I think `(!x && y)` runs the risk of being misread as `!(x && y)`, 
whereas `(x && !y)` is easy on the brain.


================
Comment at: clang/test/SemaCXX/type-traits.cpp:1472
+  int t27[F(__is_unsigned(Enum))];
+  int t28[F(__is_unsigned(UnsignedEnum))];
 }
----------------
I think you should check `F(__is_unsigned(SignedEnum))` here, too, just for the 
record.
And `F(__is_signed(UnsignedEnum))` in the other place.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98104

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to