| Summary: | REGRESSION (r204916): WTF::isValidEnum() has a typo in static_assert making it a tautological comparison | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
| Component: | Web Template Framework | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | achristensen, benjamin, cdumez, cmarcelo, darin, ews-watchlist, webkit-bug-importer, ysuzuki | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | Other | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | 161103 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
Created attachment 400089 [details]
Patch v1
Regressed in r204916: <https://trac.webkit.org/r204916> Comment on attachment 400089 [details]
Patch v1
r=me
Committed r262092: <https://trac.webkit.org/changeset/262092> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400089 [details]. |
WTF::isValidEnum() has a typo in static_assert making it a tautological comparison. template<typename E, typename T, std::enable_if_t<std::is_enum<E>::value && !std::is_same<std::underlying_type_t<E>, bool>::value && !HasCustomIsValidEnum<E>::value>* = nullptr> constexpr bool isValidEnum(T t) { static_assert(sizeof(T) >= std::underlying_type_t<E>(), "Integral type must be at least the size of the underlying enum type"); return EnumValueChecker<T, typename EnumTraits<E>::values>::isValidEnum(t); } Note that `sizeof(T) >= std::underlying_type_t<E>()` is a tautological comparison because `std::underlying_type_t<E>()` evaluates to zero.