aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/inline20.C
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2001-06-17 19:44:25 +0000
committerno-author <no-author@gcc.gnu.org>2001-06-17 19:44:25 +0000
commit5fbf0b0d5828687914c1c18a83ff12c8627d5a70 (patch)
tree0462411cdf0cad3bda574da8e490935f1995f8d6 /gcc/testsuite/g++.old-deja/g++.other/inline20.C
parenta77e41f20ecff0f4731ab8d43e54629b25d29e50 (diff)
This commit was manufactured by cvs2svn to create taggcc_3_0_release
'gcc_3_0_release'. git-svn-id: https://gcc.gnu.org/svn/gcc/tags/gcc_3_0_release@43431 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/inline20.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/inline20.C58
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline20.C b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
new file mode 100644
index 00000000000..a4af375f164
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/inline20.C
@@ -0,0 +1,58 @@
+// Build don't link:
+
+struct A {
+ int a, b, c, d;
+};
+
+inline void foo (int, A &);
+
+struct D {
+};
+
+struct E: public D {
+ void f (A &y)
+ {
+ foo (1, y);
+ }
+};
+
+struct F: public D {
+ void f (A &y)
+ {
+ foo (2, y);
+ }
+};
+
+E *d;
+F *e;
+
+inline int baz (int y)
+{
+ A a;
+ if (y) {
+ d->f (a);
+ } else {
+ e->f (a);
+ }
+ return 0;
+}
+
+inline void foo (int y, A &z)
+{
+ z.a = baz (y);
+ z.b = baz (y);
+ z.c = baz (y);
+ z.d = baz (y);
+}
+
+struct G {
+ E a;
+ F b;
+ void bar (A &);
+};
+
+void G::bar(A &y)
+{
+ a.f(y);
+ b.f(y);
+}