Features: Add cxx_extended_friend_declarations.
This commit is contained in:
parent
16603f7cdb
commit
53fe7773e6
|
@ -82,6 +82,11 @@ The features known to this version of CMake are:
|
||||||
|
|
||||||
.. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
|
.. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
|
||||||
|
|
||||||
|
``cxx_extended_friend_declarations``
|
||||||
|
Extended friend declarations, as defined in N1791_.
|
||||||
|
|
||||||
|
.. _N1791: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf
|
||||||
|
|
||||||
``cxx_extern_templates``
|
``cxx_extern_templates``
|
||||||
Extern templates, as defined in N1987_.
|
Extern templates, as defined in N1987_.
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ set(_cmake_feature_test_cxx_thread_local "${GNU48_CXX11}")
|
||||||
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
|
||||||
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
|
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
|
||||||
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
|
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
|
||||||
|
set(_cmake_feature_test_cxx_extended_friend_declarations "${GNU47_CXX11}")
|
||||||
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
|
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
|
||||||
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
|
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
|
||||||
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
|
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
F(cxx_deleted_functions) \
|
F(cxx_deleted_functions) \
|
||||||
F(cxx_enum_forward_declarations) \
|
F(cxx_enum_forward_declarations) \
|
||||||
F(cxx_explicit_conversions) \
|
F(cxx_explicit_conversions) \
|
||||||
|
F(cxx_extended_friend_declarations) \
|
||||||
F(cxx_extern_templates) \
|
F(cxx_extern_templates) \
|
||||||
F(cxx_final) \
|
F(cxx_final) \
|
||||||
F(cxx_generalized_initializers) \
|
F(cxx_generalized_initializers) \
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct B
|
||||||
|
{
|
||||||
|
B() : m_i(42) {}
|
||||||
|
private:
|
||||||
|
int m_i;
|
||||||
|
friend T;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct A
|
||||||
|
{
|
||||||
|
template<typename T>
|
||||||
|
int getBValue(B<T> b)
|
||||||
|
{
|
||||||
|
return b.m_i;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void someFunc()
|
||||||
|
{
|
||||||
|
A a;
|
||||||
|
B<A> b;
|
||||||
|
a.getBValue(b);
|
||||||
|
}
|
Loading…
Reference in New Issue