This is an archive of the discontinued LLVM Phabricator instance.

[libc++] [C++2b] [P1048] Add is_scoped_enum and is_scoped_enum_v.
ClosedPublic

Authored by curdeius on Jan 11 2021, 6:21 AM.

Diff Detail

Event Timeline

curdeius created this revision.Jan 11 2021, 6:21 AM
curdeius requested review of this revision.Jan 11 2021, 6:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2021, 6:21 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Jan 11 2021, 8:47 AM

I think we should update libcxx/docs/Cxx2bStatusPaperStatus.csv.

libcxx/include/type_traits
4186

Pleas remove this newline, or add one before the #endif.

libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp
67

Can you add a test for a function type (not a function pointer)? Also, for pointer to member function, pointer to data members and other fun things like that?

This revision now requires changes to proceed.Jan 11 2021, 8:47 AM
Mordante added inline comments.
libcxx/include/type_traits
289

is_scoped_enumer -> is_scoped_enum.

curdeius planned changes to this revision.Jan 11 2021, 11:00 AM
curdeius added inline comments.
libcxx/include/type_traits
289

Gosh, thanks for catching that.
It means that I haven't added tests for _v.

curdeius added inline comments.Jan 11 2021, 11:02 AM
libcxx/include/type_traits
289

Oh, that's the synopsis.

Mordante added inline comments.Jan 11 2021, 11:37 AM
libcxx/include/type_traits
289

Yes only the synopsis, the implementation doesn't have the typo.

curdeius updated this revision to Diff 315911.Jan 11 2021, 12:32 PM

Address review comments.

curdeius marked 2 inline comments as done.Jan 11 2021, 12:33 PM
curdeius added inline comments.
libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp
67

Is that what you meant? Any other ideas?

ldionne requested changes to this revision.Jan 11 2021, 1:48 PM

We're very very close, but there's still a few nits IMO.

libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp
67

Hmm, almost. I would have used using FunctionType = void() and then test_negative<FunctionType>() instead -- decltype(func1) is resolved as a reference to a function unless I'm mistaken.

89

I don't think this one is necessary, it's the same as testing a scoped enum outside of a class. In my mind, it's akin to testing that a scoped enumeration defined in a namespace behaves correctly -- it's testing the compiler, which isn't necessary IMO.

92

Same, not necessary IMO.

118

Unnecessary IMO, this is just testing long&.

122

Unnecessary IMO, this is just testing long&.

124

Not necessary, this is just testing for int.

This revision now requires changes to proceed.Jan 11 2021, 1:48 PM
curdeius updated this revision to Diff 316006.Jan 12 2021, 12:14 AM

Address comments.

curdeius marked 7 inline comments as done.Jan 12 2021, 12:28 AM
ldionne accepted this revision.Jan 12 2021, 6:50 AM
This revision is now accepted and ready to land.Jan 12 2021, 6:50 AM