Features: Add cxx_delegating_constructors.
This commit is contained in:
parent
9eaf375598
commit
750dfee29c
@ -16,3 +16,8 @@ The features known to this version of CMake are:
|
|||||||
Automatic type deduction, as defined in N1984_.
|
Automatic type deduction, as defined in N1984_.
|
||||||
|
|
||||||
.. _N1984: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf
|
.. _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
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
# Reference: http://gcc.gnu.org/projects/cxx0x.html
|
# Reference: http://gcc.gnu.org/projects/cxx0x.html
|
||||||
|
|
||||||
set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
|
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
|
# TODO: Should be supported by GNU 4.4
|
||||||
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||||
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
|
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
|
||||||
|
@ -42,7 +42,8 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#define FOR_EACH_CXX_FEATURE(F) \
|
#define FOR_EACH_CXX_FEATURE(F) \
|
||||||
F(cxx_auto_type)
|
F(cxx_auto_type) \
|
||||||
|
F(cxx_delegating_constructors)
|
||||||
|
|
||||||
class cmMakefile::Internals
|
class cmMakefile::Internals
|
||||||
{
|
{
|
||||||
|
15
Tests/CompileFeatures/cxx_delegating_constructors.cpp
Normal file
15
Tests/CompileFeatures/cxx_delegating_constructors.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
class Foo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Foo(int i);
|
||||||
|
|
||||||
|
Foo(double d)
|
||||||
|
: Foo(static_cast<int>(d))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_i;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user