OSDN Git Service

authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Jul 1998 14:06:48 +0000 (14:06 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Jul 1998 14:06:48 +0000 (14:06 +0000)
friend test

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21442 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.old-deja/g++.benjamin/friend01.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/friend01.C b/gcc/testsuite/g++.old-deja/g++.benjamin/friend01.C
new file mode 100644 (file)
index 0000000..66d42c5
--- /dev/null
@@ -0,0 +1,31 @@
+// Build don't link:
+//980610 bkoz
+// example 1: buggy
+
+class foo {
+public:
+    class bar;
+    int func(bar *);
+    class bar {
+        int st;
+    public:
+        bar(){st=12;}
+        ~bar(){}
+        friend int foo::func(bar *);
+    };
+    foo(){}
+    ~foo(){}
+};
+
+
+int foo::func(bar *obj) {
+  obj->st++;
+  return (obj->st);
+}
+
+void test02() {
+  foo obj_f;
+  foo::bar obj_b;
+  
+  obj_f.func( &obj_b);
+}