diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-04 09:06:02 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-08 09:05:56 (GMT) |
commit | 9064f78b0c07a79f25ee04cf8afaf726d18ec722 (patch) | |
tree | ac4addca660fb460a4636b0f191217efbd127467 | |
parent | 3322b393a265747ae7c187d426f7f1676b478de4 (diff) | |
download | CMake-9064f78b0c07a79f25ee04cf8afaf726d18ec722.zip CMake-9064f78b0c07a79f25ee04cf8afaf726d18ec722.tar.gz CMake-9064f78b0c07a79f25ee04cf8afaf726d18ec722.tar.bz2 |
Features: Add cxx_unrestricted_unions.
-rw-r--r-- | Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst | 5 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX-FeatureTests.cmake | 1 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 1 | ||||
-rw-r--r-- | Tests/CompileFeatures/cxx_unrestricted_unions.cpp | 11 |
4 files changed, 18 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst index 07defb3..0a2f23c 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst @@ -127,6 +127,11 @@ The features known to this version of CMake are: .. _N2442: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm +``cxx_unrestricted_unions`` + Unrestricted unions, as defined in N2544_. + + .. _N2544: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + ``cxx_user_literals`` User-defined literals, as defined in N2765_. diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 44af004..bd3e96e 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -26,6 +26,7 @@ set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_nullptr "${GNU46_CXX11}") set(_cmake_feature_test_cxx_range_for "${GNU46_CXX11}") +set(_cmake_feature_test_cxx_unrestricted_unions "${GNU46_CXX11}") # TODO: Should be supported by GNU 4.5 set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L") set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 993dcce..aa9b7c7 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -65,6 +65,7 @@ F(cxx_strong_enums) \ F(cxx_trailing_return_types) \ F(cxx_unicode_literals) \ + F(cxx_unrestricted_unions) \ F(cxx_user_literals) \ F(cxx_variadic_templates) diff --git a/Tests/CompileFeatures/cxx_unrestricted_unions.cpp b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp new file mode 100644 index 0000000..698fd61 --- /dev/null +++ b/Tests/CompileFeatures/cxx_unrestricted_unions.cpp @@ -0,0 +1,11 @@ + +struct point { + point() {} + point(int x, int y) : x_(x), y_(y) {} + int x_, y_; +}; +union u { + point p_; + int i_; + const char* s_; +}; |