Skip to content

Segfault on OS X when providing a custom formatting function #276

@vitaut

Description

@vitaut

Compiling and running the following code

#include "format.h"

struct Foo {};

void format(fmt::BasicFormatter<char> &f, const char *&, Foo) {}

int main() {
  fmt::print("{}", Foo());
}

results in segfault:

$ clang++ -std=c++11 -O1 test.cc format.cc
$ ./a.out 
Segmentation fault: 11

Only occurs if optimization enabled and with -std=c++11.

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