首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Emscripten和C++14

Emscripten和C++14
EN

Stack Overflow用户
提问于 2014-09-29 15:49:11
回答 1查看 1.9K关注 0票数 5

我正在使用clang3.4和最新版本的emscripten。

如果我尝试用C++14编译Hello

代码语言:javascript
复制
emcc main.cpp -std=c++1y -o test.html

Emscripten和C++14一起工作吗?

错误:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 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。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26103867

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档