Skip to content

Unexpected error in system/lib/libcxx/include/__utility/no_destroy.h #22259

@SaraBaradaran

Description

@SaraBaradaran

I faced the following error when compiling cpputest (https://github.com/cpputest/cpputest) using Emscripten. It seems there is a bug in LLVM's libc++ header system/lib/libcxx/include/__utility/no_destroy.h.

version: 3.1.63 (latest)

[ 95%] Building CXX object examples/AllTests/CMakeFiles/ExampleTests.dir/EventDispatcherTest.cpp.o
In file included from /home/sara/test2/cpputest/examples/AllTests/EventDispatcherTest.cpp:30:
In file included from /home/sara/test2/cpputest/examples/ApplicationLib/./EventDispatcher.h:31:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/list:1757:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/functional:526:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__functional/boyer_moore_searcher.h:27:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/vector:325:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__format/formatter_bool.h:20:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__format/formatter_integral.h:35:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/locale:202:
In file included from /home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__locale:18:
/home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__utility/no_destroy.h:47:10: error: type name requires a specifier or qualifier
   47 |     new (&__obj_) _Tp(std::forward<_Args>(__args)...);
      |          ^
/home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__utility/no_destroy.h:47:11: error: expected ')'
   47 |     new (&__obj_) _Tp(std::forward<_Args>(__args)...);
      |           ^
/home/sara/test2/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__utility/no_destroy.h:47:9: note: to match this '('
   47 |     new (&__obj_) _Tp(std::forward<_Args>(__args)...);
      |         ^

You can reproduce the error using the following commands:

$ git clone https://github.com/cpputest/cpputest
$ cd cpputest/build
$ emcmake cmake ..
$ emmake cmake --build .

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