Skip to content

Error in system/lib/libcxx/include/optional when _LIBCPP_STD_VER < 20 #21382

Open
@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 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 .

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