emscripten-core / emscripten-core/emscripten
Error in system/lib/libcxx/include/optional when _LIBCPP_STD_VER < 20
- 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 `system/lib/libcxx/include/optional` when _LIBCPP_STD_VER < 20.
version: latest and even 3.1.54
```
/home/sara/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/optional:419:16: error: type name requires a specifier or qualifier
419 | ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
| ^
/home/sara/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/optional:419:23: error: expected ')'
419 | ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::forward<_Args>(__args)...);
| ^
/home/sara/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__config:848:17: note: expanded from macro '_VSTD'
848 | # define _VSTD std
| ^
/home/sara/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/optional:419:15: note: to match this '('
419 | ::new ((void*)_VSTD::addressof(this->__val_)) value_type(_VSTD::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.