summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-06 08:09:37 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:57 (GMT)
commit1889045ca672e295c18203401c27a9e62ff45424 (patch)
tree80cbacfb0748db4eff985333ac8cca2ac86fefd8
parentab455ebafd55653f87168d9e6c32cfc15403a973 (diff)
downloadCMake-1889045ca672e295c18203401c27a9e62ff45424.zip
CMake-1889045ca672e295c18203401c27a9e62ff45424.tar.gz
CMake-1889045ca672e295c18203401c27a9e62ff45424.tar.bz2
Features: Add cxx_sizeof_member.
-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;
+}