Fix compile error in clang<10: fails on pragma -Wc++20-extensions

This fixes a compile error in all clang versions lower than 10,
triggered by the use of the pragma ignore with what is an unknown
warning on those compiler versions:

```
/__w/ext/fast_float/include/fast_float/parse_number.h:361:34: error: unknown warning group '-Wc++20-extensions', ignored [-Werror,-Wunknown-pragmas]
```

The fix requires looking at __clang_major__, which is unfortunately
different in Apple, so a version dispatch is required.
This commit is contained in:
Joao Paulo Magalhaes 2026-06-08 12:24:39 +01:00
parent e0b53eaf63
commit 23e245f2b3
No known key found for this signature in database

View File

@ -358,7 +358,9 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
// This is unfortunate.
#ifdef __clang__
#pragma clang diagnostic push
#if (!defined(__APPLE_CC__) && __clang_major__ >= 10) || (__clang_major__ >= 13)
#pragma clang diagnostic ignored "-Wc++20-extensions"
#endif
#endif
if fastfloat_unlikely (pns.too_many_digits) {
return parse_number_slow_path<T, UC>(first, last, value, options, bjf);