Skip to content

<format> header present in Emscripten libc++ but __cpp_lib_format undefined #25650

@anutosh491

Description

@anutosh491

I saw the header present in sysroot and I tried

// file: check_format.cpp
#include <iostream>
#include <version>   // feature-test macros live here
#include <format>    // attempt to include format if available

int main() {
#if defined(__cpp_lib_format)
    std::cout << "__cpp_lib_format is defined: " << __cpp_lib_format << std::endl;
#else
    std::cout << "__cpp_lib_format is undefined" << std::endl;
#endif
    return 0;
}

And then compiled using

anutosh491@Anutoshs-MacBook-Air clang-wasm-repl % em++ check_format.cpp -std=c++20 -o check_format.js
anutosh491@Anutoshs-MacBook-Air clang-wasm-repl % node check_format.js
__cpp_lib_format is undefined

Am I missing something here ?

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