emscripten-core / emscripten-core/emscripten
Unexpected error in system/lib/libcxx/include/__utility/no_destroy.h
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
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 .
```
Contributor guide
Assessment
This issue has not been assessed yet.