我正在使用clang3.4和最新版本的emscripten。
如果我尝试用C++14编译Hello
emcc main.cpp -std=c++1y -o test.htmlEmscripten和C++14一起工作吗?
错误:
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发布于 2014-11-12 14:36:29
更新:从1.28版本开始,Emscripten使用Clang3.4,因此在这个版本中提供了C++14特性!
Emscripten的LLVM + Clang实现Fastcomp目前基于Clang3.3 (Emscripten版本1.26)。所以答案是否定的,Emscripten暂时不适用于C++14。
https://stackoverflow.com/questions/26103867
复制相似问题