serge-sans-paille / frozen

a header-only, constexpr alternative to gperf for C++14 users
Apache License 2.0
1.33k stars 104 forks source link

Fixing "'macro' is not defined" warning, when using clang-tidy #173

Closed Sackzement closed 5 months ago

Sackzement commented 5 months ago

Using clang-tidy with frozen, shows following warning:

/path/to/frozen-git/include/frozen/bits/defines.h:62:5: warning: '__cpp_lib_constexpr_string' is not defined, evaluates to 0 [clang-diagnostic-undef]
   62 | #if __cpp_lib_constexpr_string >= 201907L
      |     ^

This commit checks if the macro __cpp_lib_constexpr_string is defined before it compares the value. The same is done with the macro __cpp_deduction_guides.

Compilers: gcc 14.1.1 20240522 clang 17.0.6

serge-sans-paille commented 5 months ago

thanks!