summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake1
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_sizeof_member.cpp10
4 files changed, 17 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index b544d7e..a16dced 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -137,6 +137,11 @@ The features known to this version of CMake are:
.. _N2118: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html
+``cxx_sizeof_member``
+ Size of non-static data members, as defined in N2253_.
+
+ .. _N2253: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html
+
``cxx_static_assert``
Static assert, as defined in N1720_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 1f56ace..a98ae3a 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -43,6 +43,7 @@ set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
+set(_cmake_feature_test_cxx_sizeof_member "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6d2a576..58c874d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -67,6 +67,7 @@
F(cxx_raw_string_literals) \
F(cxx_reference_qualified_functions) \
F(cxx_rvalue_references) \
+ F(cxx_sizeof_member) \
F(cxx_static_assert) \
F(cxx_strong_enums) \
F(cxx_thread_local) \
diff --git a/Tests/CompileFeatures/cxx_sizeof_member.cpp b/Tests/CompileFeatures/cxx_sizeof_member.cpp
new file mode 100644
index 0000000..ae143d2
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_sizeof_member.cpp
@@ -0,0 +1,10 @@
+
+struct A
+{
+ int m_i;
+};
+
+int someFunc()
+{
+ return sizeof(A::m_i) > 0 ? 1 : 2;
+}