3
這與Clang 3.1 and C++11 support status有關,但我找不到答案,我在這裏更具體:cxx_lambdas
支持鏗鏘3.1對我的確切設置。clang ++ 3.1但在Lion Xcode上沒有cxx_lambdas 4.3.3
我在OSX Lion 10.7.4上安裝了Xcode 4.3.3和最新的命令行工具包(2012年6月11日)。我現在有鐺++ 3.1版:
[email protected]:~/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
是可用的,但是這不是我得到:
[email protected]:~/projects/tests/C++11$ make
clang++ -std=c++11 -stdlib=libc++ test_clang_features.cpp -o test_clang_features
[email protected]:~/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
不可在此設置鐺++ 3.1的?
'蘋果鐺版本3.1'是不一樣'鏘版本3.1'。感謝蘋果公司製作難度較大的簡單內容。 – ildjarn