-
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
Missing formatter leads to compiler crash for clang 15 or below #3796
Comments
|
Considering that the issue only affects invalid code and fairly narrow configuration I don't think we should be implementing any workarounds in {fmt}. You can workaround compiler crash by compiling with the |
Hi @vitaut, Thank you for a provided workaround! Unfortunately, it doesn't work in all use cases for me. See modified example: https://godbolt.org/z/qn364nn97, where I explicitly use |
Are you mixing consteval-based format string checks (from your original example) with legacy compile-time checks ( |
Second example is adapted from our codebase, where we use C++17 and thus need FMT_STRING to perform compile-time argument checks. I've changed it in the original example to use C++20 and consteval, just to show that it could reproduce on more modern code. Sorry for the confusion. |
Reopening since the affected configuration is not as narrow as I thought (missed that it applies to all versions of clang <= 15). |
Worked around in 7e58af4. Thanks for reporting. |
Thank you! |
Thank you for your outstanding work on exposing compiler bugs! Even if it's not intentional, it is still outstanding :)
Here is minimal godbolt repro: https://godbolt.org/z/exoe9nKeh. Notes:
MyStruct
, crash is gone;-std=c++14
or below, crash is gone;check_format_string
with plainparse_format_string<true>(s, checker(s))
seems to avoid the crash.We would like to use new fmt version, but we're not ready yet to upgrade our toolchain to clang 16 or above. Even though the crash reproduces only if formatter is missing, the crash itself hides the real problem from the user -- they might think that compiler is just bad, and ignore the error above about missing formatter.
Do you think this is something that can be fixed or worked around in fmt codebase? If not, please advise if/how we can use new fmt versions with older clang.
The text was updated successfully, but these errors were encountered: