Skip to content

c++ 20 concept support #14236

Description

@Arcahub

Hello, I have some problems with building my c++ 20 project with emscripten. The problems seems to be with c++20 concepts.
I made a little example:

main.cpp

#include <concepts>

template <typename T>
concept Test = std::movable<T>;

template <Test T>
class MyTest {
public:
    T value;
};

int main()
{
    MyTest<int> test;
}

with em++ -std=c++20 main.cpp

while result with an error as :

main.cpp:1:10: fatal error: 'concepts' file not found
#include <concepts>
         ^~~~~~~~~~
1 error generated.
emcc: error: '/tmp/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=2 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=21 -D_LIBCPP_ABI_VERSION=2 -Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/tmp/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -std=c++20 main.cpp -c -o /tmp/emscripten_temp_gra_mqr_/main_0.o' failed (1)

I know c++20 concept are recent feature so i thought it might be emscripten that doesn't support this feature.

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