Skip to content

ROOT Cling cannot run with libfmt #19335

@YanzhaoW

Description

@YanzhaoW

Check duplicate issues.

  • Checked for duplicates

Description

Hi,

I have encountered a compilation issue when using libfmt inside ROOT Cling interpreter.

Reproducer

  1. Open the root:
root -l
  1. include libfmt:
#include <fmt/format.h>
  1. print hello world:
fmt::println("hello world");

The error message would be:

ROOT_prompt_3:1:14: error: call to consteval function 'fmt::fstring<>::fstring<12UL>' is not a constant expression
fmt::println("hello world");
             ^
note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
/opt/FairSoft/include/fmt/base.h:2736:54: note: in call to 'basic_string_view(&"hello world"[0])'
    if (FMT_USE_CONSTEVAL) parse_format_string<char>(s, checker(s, arg_pack()));
                                                     ^
ROOT_prompt_3:1:14: note: in call to 'fstring<12UL>("hello world")'
fmt::println("hello world");
             ^~~~~~~~~~~~~

ROOT version

6.36.00

Installation method

build from source

Operating system

Fedora 42

Additional context

libfmt version: 11.2.0
C++ standard: 23

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Issues

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions