[Cmake-commits] CMake branch, next, updated. v3.2.1-1511-g4bf326d

Brad King brad.king at kitware.com
Mon Apr 6 10:12:40 EDT 2015


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  4bf326d69cf167d8deb892339d96dc44eddb416f (commit)
       via  ecb1d5b47a75a88653fe508abec1a664cc81595f (commit)
       via  827309af76fe3f51a2d589148ef98cf91f510c2b (commit)
      from  7ab2d0f90ecb24878ebeef37bbe845d0b88a066c (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=4bf326d69cf167d8deb892339d96dc44eddb416f
commit 4bf326d69cf167d8deb892339d96dc44eddb416f
Merge: 7ab2d0f ecb1d5b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 6 10:12:39 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Apr 6 10:12:39 2015 -0400

    Merge topic 'vs-compiler-feature-2013-update' into next
    
    ecb1d5b4 Features: VS 2013 Update 3 supports initializer lists (#15494)
    827309af Tests: Fix CompileFeatures cxx_generalized_initializers example


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ecb1d5b47a75a88653fe508abec1a664cc81595f
commit ecb1d5b47a75a88653fe508abec1a664cc81595f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 6 09:59:51 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 6 10:06:26 2015 -0400

    Features: VS 2013 Update 3 supports initializer lists (#15494)
    
    VS 2013 originally claimed to support initializer lists but a bug was
    found in which it generated bad code silently.  For this reason we
    previously considered support to not be present.  However, Update 3 adds
    a hard error on cases that previously generated bad code, so it is now
    safe to use initializer lists with VS 2013 Update 3 or greater.  At
    worst a compiler error will be issued in the cases that do not work, but
    that is no different from any other compiler-specific workaround a
    project code may need.

diff --git a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
index c770211..fcedf3c 100644
--- a/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/MSVC-CXX-FeatureTests.cmake
@@ -16,12 +16,6 @@ set(_cmake_feature_test_cxx_decltype_auto "${MSVC_2015}")
 # says they will be available in the RTM.
 set(_cmake_feature_test_cxx_digit_separators "${MSVC_2015}")
 set(_cmake_feature_test_cxx_func_identifier "${MSVC_2015}")
-# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
-# Note 1. While previous version of VisualStudio said they supported these
-# they silently produced bad code, and are now marked as having partial
-# support in previous versions. The footnote says the support will be complete
-# in MSVC 2015, so support the feature for that version, assuming that is true.
-set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2015}")
 set(_cmake_feature_test_cxx_nonstatic_member_init "${MSVC_2015}")
 # Microsoft calls this 'rvalue references v3'
 set(_cmake_feature_test_cxx_defaulted_move_initializers "${MSVC_2015}")
@@ -44,6 +38,16 @@ set(_cmake_feature_test_cxx_reference_qualified_functions "${MSVC_2015}")
 # lists this as 'partial' in 2013
 set(_cmake_feature_test_cxx_deleted_functions "${MSVC_2015}")
 
+set(MSVC_2013_v30723 "_MSC_FULL_VER >= 180030723")
+# http://blogs.msdn.com/b/vcblog/archive/2014/11/17/c-11-14-17-features-in-vs-2015-preview.aspx
+# Note 1. While previous version of VisualStudio said they supported these
+# they silently produced bad code, and are now marked as having partial
+# support in previous versions. The footnote says the support will be complete
+# in MSVC 2015, so support the feature for that version, assuming that is true.
+# The blog post also says that VS 2013 Update 3 generates an error in cases
+# that previously produced bad code.
+set(_cmake_feature_test_cxx_generalized_initializers "${MSVC_2013_v30723}")
+
 set(MSVC_2013 "_MSC_VER >= 1800")
 set(_cmake_feature_test_cxx_alias_templates "${MSVC_2013}")
 # Microsoft now states they support contextual conversions in 2013 and above.
@@ -101,6 +105,7 @@ set(_cmake_feature_test_cxx_variadic_macros "${MSVC_2010}")
 # Unset all the variables that we don't need exposed.
 # _cmake_oldestSupported is required by WriteCompilerDetectionHeader
 set(MSVC_2015)
+set(MSVC_2013_v30723)
 set(MSVC_2013)
 set(MSVC_2012)
 set(MSVC_2010)
diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
index 13544f3..ad05f12 100644
--- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp
+++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
@@ -1,5 +1,5 @@
-#if defined(_MSC_VER) && _MSC_VER == 1800
-# error "VS 2013 does not safely support this"
+#if defined(_MSC_VER) && _MSC_VER == 1800 && _MSC_FULL_VER < 180030723
+# error "VS 2013 safely supports this only with Update 3 or greater"
 #endif
 
 // Dummy implementation. Test only the compiler feature.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=827309af76fe3f51a2d589148ef98cf91f510c2b
commit 827309af76fe3f51a2d589148ef98cf91f510c2b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Apr 6 09:54:52 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Apr 6 10:05:37 2015 -0400

    Tests: Fix CompileFeatures cxx_generalized_initializers example
    
    The only reason this failed to compile on VS 2013 was because the
    compiler uses different initializer_list constructor argument types than
    our dummy implementation.  The standard does not specify the non-default
    constructor argument types for initializer_list.  Use a template to
    match any two-arg constructor a compiler might select (e.g. begin/end or
    begin/len).  Use #error to preserve the error on VS 2013.

diff --git a/Tests/CompileFeatures/cxx_generalized_initializers.cpp b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
index 7bf356b..13544f3 100644
--- a/Tests/CompileFeatures/cxx_generalized_initializers.cpp
+++ b/Tests/CompileFeatures/cxx_generalized_initializers.cpp
@@ -1,3 +1,6 @@
+#if defined(_MSC_VER) && _MSC_VER == 1800
+# error "VS 2013 does not safely support this"
+#endif
 
 // Dummy implementation. Test only the compiler feature.
 namespace std {
@@ -7,8 +10,9 @@ namespace std {
   {
     const _E* __begin_;
     size_t    __size_;
-
-    initializer_list(const int*, long unsigned int) {}
+  public:
+    template <typename T1, typename T2>
+    initializer_list(T1, T2) {}
   };
 }
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/Compiler/MSVC-CXX-FeatureTests.cmake          |   17 +++++++++++------
 .../CompileFeatures/cxx_generalized_initializers.cpp  |    8 ++++++--
 2 files changed, 17 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list