Commit 542c293
EnumTraits.h: error: no matching function for call to 'enumName' with Clang 20
https://bugs.webkit.org/show_bug.cgi?id=289669
Reviewed by Keith Miller.
Clang 20 couldn't compile EnumTraits.h.
> wtf/EnumTraits.h:212:33: note: candidate template ignored: invalid explicitly-specified argument for template parameter 'V'
An invalid enum value can't be specifed to the template parameter `V`.
> template<auto V> constexpr std::span<const char> enumName()
The upstream Magic Enum C++ has a template variable `is_enum_constexpr_static_cast_valid<E, V>` to check a enum value is valid.
<https://github.com/Neargye/magic_enum/blob/a413fcc9c46a020a746907136a384c227f3cd095/include/magic_enum/magic_enum.hpp#L624-L634>
Imported the template variable.
* Source/WTF/wtf/EnumTraits.h:
(WTF::enumName):
(WTF::makeEnumNames):
Canonical link: https://commits.webkit.org/292321@main1 parent c255458 commit 542c293
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
164 | 174 | | |
165 | 175 | | |
166 | 176 | | |
| |||
224 | 234 | | |
225 | 235 | | |
226 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
| |||
243 | 262 | | |
244 | 263 | | |
245 | 264 | | |
246 | | - | |
| 265 | + | |
247 | 266 | | |
248 | 267 | | |
249 | 268 | | |
| |||
0 commit comments