summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-06 08:37:52 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:57 (GMT)
commit53fe7773e6335b71161310a2c948bc99145ee59e (patch)
tree766ed4dc4a4666a1499b54e6ae7fcfb74a05ea1e /Tests/CompileFeatures
parent16603f7cdb76ad4f9377d583b5234d92f85dd22d (diff)
downloadCMake-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.cpp25
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);
+}