Page MenuHomePhabricator

[libcxx] teach type_traits test about long uint32_t
AcceptedPublic

Authored by bcain on May 7 2019, 1:56 PM.

Details

Summary

Patch by Ben Craig.

Diff Detail

Event Timeline

bcain created this revision.May 7 2019, 1:56 PM
EricWF accepted this revision.May 7 2019, 5:22 PM

This LGTM.

Although wouldn't unsigned int be the correct choice on all platforms? Because the issue only arises because sometimes uint32_t is unsigned long instead of unsigned int?

This revision is now accepted and ready to land.May 7 2019, 5:22 PM
bcain added a comment.May 7 2019, 5:48 PM

This LGTM.

Although wouldn't unsigned int be the correct choice on all platforms? Because the issue only arises because sometimes uint32_t is unsigned long instead of unsigned int?

The standard only guarantees that unsigned int is >= 16 bit so IIUC in that case it can't be compared with char32_t here.

C++17 [basic.fundamental] => C99 5.2.4.2.1

I'm not a language lawyer, I had to look this one up. But AFAICT that's why unsigned int is insufficiently portable for this test.