Skip to content

Missing formatter leads to compiler crash for clang 15 or below #3796

Description

@BobIsOnFire

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:

  • Reproduces ever since fmt 10.1.0;
  • If I write a formatter for MyStruct, crash is gone;
  • If I select clang 16.0.0 or above, crash is gone;
  • If I set -std=c++14 or below, crash is gone;
  • In my local testing, replacing two last lines in check_format_string with plain parse_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions