Question Details

No question body available.

Tags

c++ printing c++23 compiler-bug

Answers (1)

Accepted Answer Available
Accepted Answer
January 11, 2026 Score: 3 Rep: 47,915 Quality: Expert Completeness: 80%

Is this some sort of undefined behavior, or is it a bug in this particular compiler?

Yes, this is definitely a well-formed program and so a compiler bug/issue or compiler explorer backend issue like this.

From std::println's documentation, the call std::println("hello from {}", "me"); is equivalent to:

std::println(stdout, "hello from {}", "me"); 

which itself is equivalent to:

std::print(stdout, "{}\n", std::format("hello from {}", "me"));

both of which should themselves result in a well-formed program.


Note

There have been some similar old bug reports(termination with sigbus) for compiler explorer in the past, for example C++: ARM64 gcc trunk and 15.1 "Execute the code" fails with sigbus. This may or may not be related to these old issue(s) which btw are still open.