[PATCH] D39064: implement __has_unique_object_representations

Stephan T. Lavavej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 15:19:25 PDT 2017


STL_MSFT added a comment.

Looks good to me modulo comments.



================
Comment at: lib/Parse/ParseExpr.cpp:719
 ///                   '__is_union'
+///                   '__has_unique_object_representations'   [MS]
 ///
----------------
Should this be marked as MS if it's cross-vendor?


================
Comment at: test/SemaCXX/type-traits.cpp:2403
+static_assert(has_unique_object_representations<bool>::value, "yes, all integral types");
+static_assert(has_unique_object_representations<char>::value, "and pointer to members");
+static_assert(has_unique_object_representations<signed char>::value, "and pointer to members");
----------------
char is a pointer to member! What a world. (ditto below)


================
Comment at: test/SemaCXX/type-traits.cpp:2420
+static_assert(!has_unique_object_representations<decltype(nullptr)>::value, "or nullptr_t");
+static_assert(!has_unique_object_representations<float>::value, "definitely not FP");
+static_assert(!has_unique_object_representations<double>::value, "definitely not FP");
----------------
The use of "FP" to mean "floating point" is a little confusing given the FP typedef for Function Pointer above.


https://reviews.llvm.org/D39064





More information about the cfe-commits mailing list