I am using clang 3.4 and the newest version of emscripten.
If I try to compile Hello World with C++14
emcc main.cpp -std=c++1y -o test.html
Does Emscripten work with C++14?
Error:
In file included from main.cpp:1:
In file included from /usr/share/emscripten/system/include/libcxx/iostream:38:
In file included from /usr/share/emscripten/system/include/libcxx/ios:216:
In file included from /usr/share/emscripten/system/include/libcxx/__locale:15:
In file included from /usr/share/emscripten/system/include/libcxx/string:439:
In file included from /usr/share/emscripten/system/include/libcxx/algorithm:627:
In file included from /usr/share/emscripten/system/include/libcxx/memory:601:
/usr/share/emscripten/system/include/libcxx/__functional_base:72:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
In file included from main.cpp:1:
In file included from /usr/share/emscripten/system/include/libcxx/iostream:38:
In file included from /usr/share/emscripten/system/include/libcxx/ios:216:
In file included from /usr/share/emscripten/system/include/libcxx/__locale:18:
In file included from /usr/share/emscripten/system/include/libcxx/mutex:177:
/usr/share/emscripten/system/include/libcxx/functional:506:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:531:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:556:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:581:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:606:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:631:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_Tp&& __x) const
^
/usr/share/emscripten/system/include/libcxx/functional:656:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:681:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:706:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:733:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:758:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:783:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:808:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:833:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_Tp&& __x) const
^
/usr/share/emscripten/system/include/libcxx/functional:858:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:883:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:908:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_T1&& __t, _T2&& __u) const
^
/usr/share/emscripten/system/include/libcxx/functional:929:10: error: constexpr function's return type 'auto' is not a literal type
auto operator()(_Tp&& __x) const
^
19 errors generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
UPDATE: Starting from version 1.28 Emscripten uses Clang 3.4, so C++14 features are available in this version!
Emscripten's LLVM + Clang implementation Fastcomp is based on Clang 3.3 at the moment (Emscripten version 1.26). So the answer is no, Emscripten doesn't work with C++14 for now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With