diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-04-06 08:37:52 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-08 09:05:57 (GMT) |
commit | 53fe7773e6335b71161310a2c948bc99145ee59e (patch) | |
tree | 766ed4dc4a4666a1499b54e6ae7fcfb74a05ea1e /Tests/CompileFeatures | |
parent | 16603f7cdb76ad4f9377d583b5234d92f85dd22d (diff) | |
download | CMake-53fe7773e6335b71161310a2c948bc99145ee59e.zip CMake-53fe7773e6335b71161310a2c948bc99145ee59e.tar.gz CMake-53fe7773e6335b71161310a2c948bc99145ee59e.tar.bz2 |
Features: Add cxx_extended_friend_declarations.
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r-- | Tests/CompileFeatures/cxx_extended_friend_declarations.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp new file mode 100644 index 0000000..631c699 --- /dev/null +++ b/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp @@ -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); +} |