RESOLVED FIXED 212290
REGRESSION (r204916): WTF::isValidEnum() has a typo in static_assert making it a tautological comparison
https://bugs.webkit.org/show_bug.cgi?id=212290
Summary REGRESSION (r204916): WTF::isValidEnum() has a typo in static_assert making i...
David Kilzer (:ddkilzer)
Reported 2020-05-22 16:50:53 PDT
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.
Attachments
Patch v1 (1.61 KB, patch)
2020-05-22 16:54 PDT, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2020-05-22 16:54:00 PDT
Created attachment 400089 [details] Patch v1
David Kilzer (:ddkilzer)
Comment 2 2020-05-22 16:56:09 PDT
Yusuke Suzuki
Comment 3 2020-05-22 17:44:04 PDT
Comment on attachment 400089 [details] Patch v1 r=me
EWS
Comment 4 2020-05-22 20:31:28 PDT
Committed r262092: <https://trac.webkit.org/changeset/262092> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400089 [details].
Radar WebKit Bug Importer
Comment 5 2020-05-22 20:32:15 PDT
Note You need to log in before you can comment on or make changes to this bug.