Features: Add cxx_sizeof_member.

This commit is contained in:
Stephen Kelly 2014-04-06 10:09:37 +02:00
parent ab455ebafd
commit 1889045ca6
4 changed files with 17 additions and 0 deletions

View File

@ -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_.

View File

@ -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}")

View File

@ -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) \

View File

@ -0,0 +1,10 @@
struct A
{
int m_i;
};
int someFunc()
{
return sizeof(A::m_i) > 0 ? 1 : 2;
}