[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-1963-g0a74c9e
Stephen Kelly
steveire at gmail.com
Sun Apr 6 07:44:02 EDT 2014
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 0a74c9ebaaee57ac0cb7557b7900bd0f6703d462 (commit)
via 2853f302f1c17de9c97e36e61469431445670cca (commit)
via 809bd865b50c1c28e71c558a27891278576e320e (commit)
from 57905c8601d34ad8a5aa09d2ccd42f8b3acacaa6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a74c9ebaaee57ac0cb7557b7900bd0f6703d462
commit 0a74c9ebaaee57ac0cb7557b7900bd0f6703d462
Merge: 57905c8 2853f30
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 07:44:01 2014 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Apr 6 07:44:01 2014 -0400
Merge topic 'clang-3.4-features' into next
2853f302 Resolve some warnings.
809bd865 Features: Record for Clang 3.4.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2853f302f1c17de9c97e36e61469431445670cca
commit 2853f302f1c17de9c97e36e61469431445670cca
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 13:40:57 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 13:41:53 2014 +0200
Resolve some warnings.
diff --git a/Tests/CompileFeatures/cxx_alignof.cpp b/Tests/CompileFeatures/cxx_alignof.cpp
index 2f730c4..63b14fe 100644
--- a/Tests/CompileFeatures/cxx_alignof.cpp
+++ b/Tests/CompileFeatures/cxx_alignof.cpp
@@ -1,6 +1,5 @@
int someFunc()
{
- int i = 42;
- return alignof(i);
+ return alignof(int);
}
diff --git a/Tests/CompileFeatures/cxx_func_identifier.cpp b/Tests/CompileFeatures/cxx_func_identifier.cpp
index d6166f8..0c3595c 100644
--- a/Tests/CompileFeatures/cxx_func_identifier.cpp
+++ b/Tests/CompileFeatures/cxx_func_identifier.cpp
@@ -1,5 +1,6 @@
void someFunc()
{
- sizeof(__func__);
+ bool b = sizeof(__func__);
+ (void)b;
}
diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
index f4cd999..8013ef5 100644
--- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp
+++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
@@ -17,7 +17,7 @@ struct A
A(std::initializer_list<T>) {}
};
-int someFunc()
+void someFunc()
{
A<int> as = { 1, 2, 3, 4 };
}
diff --git a/Tests/CompileFeatures/cxx_lambdas.cpp b/Tests/CompileFeatures/cxx_lambdas.cpp
index 48431ba..eecaa23 100644
--- a/Tests/CompileFeatures/cxx_lambdas.cpp
+++ b/Tests/CompileFeatures/cxx_lambdas.cpp
@@ -1,5 +1,5 @@
void someFunc()
{
- [](){};
+ [](){}();
}
diff --git a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
index ce69892..83a2361 100644
--- a/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
+++ b/Tests/CompileFeatures/cxx_reference_qualified_functions.cpp
@@ -4,7 +4,7 @@ struct test{
void f() && { }
};
-int someFunc(){
+void someFunc(){
test t;
t.f(); // lvalue
test().f(); // rvalue
diff --git a/Tests/CompileFeatures/cxx_variadic_macros.cpp b/Tests/CompileFeatures/cxx_variadic_macros.cpp
index 2b8d0a4..4d007a5 100644
--- a/Tests/CompileFeatures/cxx_variadic_macros.cpp
+++ b/Tests/CompileFeatures/cxx_variadic_macros.cpp
@@ -1,7 +1,7 @@
int someFunc(int, char, int)
{
-
+ return 0;
}
#define FUNC_WRAPPER(...) someFunc(__VA_ARGS__)
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=809bd865b50c1c28e71c558a27891278576e320e
commit 809bd865b50c1c28e71c558a27891278576e320e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Apr 6 13:35:16 2014 +0200
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Apr 6 13:38:09 2014 +0200
Features: Record for Clang 3.4.
diff --git a/Modules/Compiler/Clang-CXX-FeatureTests.cmake b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
new file mode 100644
index 0000000..3221ee7
--- /dev/null
+++ b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
@@ -0,0 +1,68 @@
+
+# Reference: http://clang.llvm.org/cxx_status.html
+# http://clang.llvm.org/docs/LanguageExtensions.html
+
+set(testable_features
+ cxx_reference_qualified_functions
+ cxx_decltype_incomplete_return_types
+ cxx_inheriting_constructors
+ cxx_alignas
+ cxx_attributes
+ cxx_thread_local
+ cxx_delegating_constructors
+ cxx_nonstatic_member_init
+ cxx_noexcept
+ cxx_alias_templates
+ cxx_user_literals
+ cxx_constexpr
+ cxx_nullptr
+ cxx_range_for
+ cxx_unrestricted_unions
+ cxx_explicit_conversions
+ cxx_lambdas
+ cxx_raw_string_literals
+ cxx_local_type_template_args
+ cxx_variadic_templates
+ cxx_auto_type
+ cxx_strong_enums
+ cxx_defaulted_functions
+ cxx_deleted_functions
+ cxx_unicode_literals
+ cxx_generalized_initializers
+ cxx_static_assert
+ cxx_decltype
+ cxx_rvalue_references
+ cxx_default_function_template_args
+)
+foreach(feature ${testable_features})
+ set(_cmake_feature_test_${feature} "__has_feature(${feature})")
+endforeach()
+
+unset(testable_features)
+
+set(_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 304")
+
+set(_cmake_feature_test_gnu_cxx_typeof "${_oldestSupported} && !defined(__STRICT_ANSI__)")
+set(_cmake_feature_test_cxx_alignof "__has_feature(cxx_alignas)")
+set(_cmake_feature_test_cxx_final "__has_feature(cxx_override_control)")
+set(_cmake_feature_test_cxx_override "__has_feature(cxx_override_control)")
+set(_cmake_feature_test_cxx_uniform_initialization "__has_feature(cxx_generalized_initializers)")
+set(_cmake_feature_test_cxx_auto_function "__has_feature(cxx_auto_type)")
+
+# TODO: Should be supported by Clang 3.1
+set(_cmake_feature_test_cxx_enum_forward_declarations "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_sizeof_member "${_oldestSupported} && __cplusplus >= 201103L")
+# TODO: Should be supported by Clang 2.9
+set(_cmake_feature_test_cxx_extended_friend_declarations "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_inline_namespaces "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_right_angle_brackets "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_long_long_type "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_extern_templates "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_variadic_macros "${_oldestSupported} && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_func_identifier "${_oldestSupported} && __cplusplus >= 201103L")
+
+# TODO: Should be supported forever?
+set(_cmake_feature_test_cxx_template_template_parameters "${_oldestSupported} && __cplusplus >= 199711L")
+set(_cmake_feature_test_gnu_cxx_typeof "${_oldestSupported} && !defined(__STRICT_ANSI__)")
+
+set(_oldestSupported)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index a1b3a10..bdfefd7 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -22,3 +22,17 @@ elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.1)
set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
endif()
+
+macro(cmake_record_cxx_compile_features)
+ macro(_get_clang_features std_version list)
+ record_compiler_features(CXX "-std=${std_version}" ${list})
+ endmacro()
+
+ if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+ _get_clang_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
+ _get_clang_features(c++98 CMAKE_CXX98_COMPILE_FEATURES)
+ _get_clang_features(gnu++98 CMAKE_CXX98_COMPILE_EXTENSIONS)
+ else()
+ set(_result 0)
+ endif()
+endmacro()
-----------------------------------------------------------------------
Summary of changes:
Modules/Compiler/Clang-CXX-FeatureTests.cmake | 68 ++++++++++++++++++++
Modules/Compiler/Clang-CXX.cmake | 14 ++++
Tests/CompileFeatures/cxx_alignof.cpp | 3 +-
Tests/CompileFeatures/cxx_func_identifier.cpp | 3 +-
.../cxx_generalized_initializers.cpp | 2 +-
Tests/CompileFeatures/cxx_lambdas.cpp | 2 +-
.../cxx_reference_qualified_functions.cpp | 2 +-
Tests/CompileFeatures/cxx_variadic_macros.cpp | 2 +-
8 files changed, 89 insertions(+), 7 deletions(-)
create mode 100644 Modules/Compiler/Clang-CXX-FeatureTests.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list