Skip to content

c++ 20 concept support #14236

Closed
Closed

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.

Activity

  1. sbc100 commented on May 19, 2021

    @sbc100
    Collaborator

    This would require us to upgrade our version of libcxx.. which is something we should probably do anyway. Currently we include the llvm-10 version (

    These files are from libc++, release branch 10.x.
    ) but version 11 and 12 have been released since then.

  2. Arcahub commented on May 20, 2021

    @Arcahub
    Author

    Thank you for your fast answer do you have any idea of when this update can be released ?

  3. sbc100 commented on May 20, 2021

    @sbc100
    Collaborator

    I opened a new issue to update our llvm libraries: #14244

    Its hard to say how long it will take someone to take a look at it.

  4. added a commit that references this issue on May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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