]> gcc.gnu.org Git - gcc.git/commitdiff
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 28 Jul 1998 14:07:12 +0000 (14:07 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 28 Jul 1998 14:07:12 +0000 (14:07 +0000)
try 2

From-SVN: r21443

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

diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/friend02.C b/gcc/testsuite/g++.old-deja/g++.benjamin/friend02.C
new file mode 100644 (file)
index 0000000..e9520e3
--- /dev/null
@@ -0,0 +1,31 @@
+// Build don't link:
+//980610 bkoz
+// example 2: ok
+
+class bar;
+class foo {
+public:
+    int func(bar *);
+    foo(){}
+    ~foo(){}
+};
+
+class bar {
+  int st;
+public:
+  bar(){st=12;}
+  ~bar(){}
+  friend int foo::func(bar *);
+};
+
+int foo::func(bar *obj) {
+  obj->st++;
+  return (obj->st);
+}
+
+void test02() {
+  foo obj_f;
+  bar obj_b;
+  
+  obj_f.func( &obj_b);
+}
This page took 0.062998 seconds and 5 git commands to generate.