This is an archive of the discontinued LLVM Phabricator instance.

[clang][NFC] refactors value type traits so we can have more than bools
ClosedPublic

Authored by cjdb on Jun 2 2023, 2:23 PM.

Details

Summary

Since all the type traits up until now have had Boolean vaules, we've
always been able to assume that the expressions are bool. This is
about to change (D151952 introduces a trait that returns size_t), so
we need to restructure the code so it doesn't become unwieldy.

This is achieved by giving traits a designated "return" type.

Diff Detail

Event Timeline

cjdb created this revision.Jun 2 2023, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 2:23 PM
cjdb requested review of this revision.Jun 2 2023, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 2:23 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Jun 2 2023, 2:28 PM
This revision is now accepted and ready to land.Jun 2 2023, 2:28 PM
nickdesaulniers added inline comments.
clang/lib/Sema/SemaExprCXX.cpp
5591–5594
llvm-project/clang/lib/Sema/SemaExprCXX.cpp:5591:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
  default:
  ^
nickdesaulniers added inline comments.
clang/lib/Sema/SemaExprCXX.cpp
5591–5594

commit caf00725923c ("[Sema] Fix a warning")
via @kazu