Features: Add cxx_delegating_constructors.

This commit is contained in:
Stephen Kelly 2014-04-07 17:28:55 +02:00
parent 9eaf375598
commit 750dfee29c
4 changed files with 25 additions and 1 deletions

View File

@ -16,3 +16,8 @@ The features known to this version of CMake are:
Automatic type deduction, as defined in N1984_.
.. _N1984: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
``cxx_delegating_constructors``
Delegating constructors, as defined in N1986_.
.. _N1986: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf

View File

@ -2,6 +2,9 @@
# Reference: http://gcc.gnu.org/projects/cxx0x.html
set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
# TODO: Should be supported by GNU 4.7
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
# TODO: Should be supported by GNU 4.4
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")

View File

@ -42,7 +42,8 @@
#include <assert.h>
#define FOR_EACH_CXX_FEATURE(F) \
F(cxx_auto_type)
F(cxx_auto_type) \
F(cxx_delegating_constructors)
class cmMakefile::Internals
{

View File

@ -0,0 +1,15 @@
class Foo
{
public:
Foo(int i);
Foo(double d)
: Foo(static_cast<int>(d))
{
}
private:
int m_i;
};