summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures/cxx_extended_friend_declarations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CompileFeatures/cxx_extended_friend_declarations.cpp')
-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);
+}