clang++ 3.1,但在Lion Xcode 4.3.3上没有“cxx_lambdas”
clang++ 3.1 but no `cxx_lambdas` on Lion Xcode 4.3.3
这与 Clang 3.1 和 C++11 支持状态有关,但我在那里找不到答案,我在这里更具体:在我的确切设置上对 clang 3.1 cxx_lambdas
支持。
我在OSX Lion 10.7.4上安装了Xcode 4.3.3和最新的命令行工具包(2012年6月11日)。我现在有 clang++ 版本 3.1:
llins@jupara:~/projects/tests/C++11$ clang++ -v
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
基于 http://clang.llvm.org/cxx_status.html,我希望cxx_lambdas
可用的功能,但这不是我得到的:
llins@jupara:~/projects/tests/C++11$ make
clang++ -std=c++11 -stdlib=libc++ test_clang_features.cpp -o test_clang_features
llins@jupara:~/projects/tests/C++11$ ./test_clang_features
FAILED feature tests:
__has_feature(cxx_constexpr) .................................. FAILED
__has_feature(cxx_generalized_initializers) ................... FAILED
__has_feature(cxx_inheriting_constructors) .................... FAILED
__has_feature(cxx_lambdas) .................................... FAILED
__has_feature(cxx_local_type_template_args) ................... FAILED
__has_feature(cxx_unrestricted_unions) ........................ FAILED
__has_feature(cxx_user_literals) .............................. FAILED
这是我为获取此报告而运行的代码:
#include <iostream>
using namespace std;
void main()
{
cout << "FAILED feature tests: " << endl;
// testing all features cxx_???? described in (only 3 shown here):
// http://llvm.org/releases/3.1/tools/clang/docs/LanguageExtensions.html#cxx11
#if !__has_feature(cxx_generalized_initializers)
cout << "__has_feature(cxx_generalized_initializers) ................... FAILED" << endl;
#endif
#if !__has_feature(cxx_implicit_moves)
cout << "__has_feature(cxx_implicit_moves) ............................. FAILED" << endl;
#endif
//... analogous tests ...
#if !__has_feature(cxx_lambdas)
cout << "__has_feature(cxx_lambdas) .................................... FAILED" << endl;
#endif
}
请注意,cxx_lambdas
失败了。以下是测试功能的完整列表:
cxx_access_control_sfinae cxx_alias_templates cxx_alignas
cxx_attributes cxx_auto_type cxx_constexpr cxx_decltype
cxx_default_function_template_args cxx_defaulted_functions
cxx_delegating_constructors cxx_deleted_functions cxx_exceptions
cxx_explicit_conversions cxx_generalized_initializers
cxx_implicit_moves cxx_inheriting_constructors cxx_inline_namespaces
cxx_lambdas cxx_local_type_template_args cxx_noexcept
cxx_nonstatic_member_init cxx_nullptr cxx_override_control
cxx_range_for cxx_raw_string_literals
cxx_reference_qualified_functions cxx_rtti cxx_rvalue_references
cxx_static_assert cxx_strong_enums cxx_trailing_return
cxx_unicode_literals cxx_unrestricted_unions cxx_user_literals
cxx_variadic_templates
为什么cxx_lambdas
在 clang++ 3.1 的此设置中不可用?
Lambada 支持将在 Xcode 4.4+
中提供苹果的clang/llvm发行版是定制的,正如ildjarn指出的那样......
相关文章:
- xmake总是报告:错误:无法获取cxx的程序,为什么
- 为什么在C++20中对lambdas使用"std::bind_front"
- 在 Julia 中使用 boost 库和 Windows 上的 Cxx.jl
- Cxx.jl 在 Julia Complex 和 std::complex 之间进行转换
- 仅为C++文件(.h、.cpp、.cxx、.c)生成标记文件
- JavaScript箭头函数:我们能否像C ++ lambdas一样捕获值
- 在为 iOS 构建 aws-sdk-cpp 时,cmake 上的 CXX 编译器错误已损坏
- c++ 链接器错误"针对'.rodata.str1.1'的重新定位R_X86_64_32"链接 CXX 共享库 libsrt.so
- 使用CMake ExternalProject_Add构建mongo cxx驱动程序
- 使用lambdas初始化多维数组
- C++17中没有自动参数的模板lambdas
- CMake 识别 MSVC(C 和 CXX),但仍抛出"未找到 CMAKE_*_COMPILER"
- Julia Cxx 在模块中打包不同的行为
- 检查工作正常的 CXX 编译器:/cygdrive/c/cygwin64/bin/clang++ -- 已损坏
- 通过引用捕获与移动,lambdas
- C++编译器 g++.exe 无法编译简单的测试程序 - 确定 CXX 编译器是否工作失败
- Mongodb Cxx 驱动程序测试在发布版本中崩溃 [ 在调试中工作正常]
- 我可以使用匿名lambdas坚持静态值
- 使用 CXX 社区插件在 Sonarqube-5.6.6(LTS) 中导入 Gcov 报告
- lambdas的可继承性是否由标准保证