-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fmt/std.h requires rtti #3464
Comments
The alternative solution would be to conditionally deactivate those parts of fmt/std.h requiring RTTI when RTTI is deactivated. From a user-point of view this seems to me the better approach. |
I would be okay with either! Would that also be more compatible with being in a module? |
Same as #3426. A PR to make RTTI usage condition (but not splitting std.h) would be welcome. |
Ok thanks. Here’s a method to determine RTTI state, did not test it to verify yet: https://gist.github.com/brimston3/2be168bb423c83b0f469c0be56e66d31 |
According to boost/config/compiler/gcc.hpp#L122 for GCC you need to test for the GCC version as well to be sure about RTTI being enabled, but it is possible that fmtlib doesn't support older GCCs anyway (You should check). Following further the boost RTTI detection for other compilers there are some further checks helpful (e.g. for intel there exists INTEL_RTTI) and others. I recommend to search for RTTI in the include/boost/config/ directory to collect them. |
Works for MSVC, GCC, and Clang: https://godbolt.org/z/W5v595jo8 I can't test Intel on compiler explorer. |
Compiler support:
So yeah, I'll grab all of those from boost. Thanks @Dani-Hub |
That check is for gcc 4.3, but fmt 10+ requires GCC 4.8, so I will omit that. |
Version: 10.0.0
I would like to use fmt/std.h to format std::string_view and such. I am compiling without RTTI.
But the std::exception specialization uses:
which does not compile with RTTI disabled in Clang or GCC.
Could we split this type which requires RTTI into a separate header?
The text was updated successfully, but these errors were encountered: