summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/conv9.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/conv9.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv9.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv9.C b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
new file mode 100644
index 000000000..0fcf980be
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv9.C
@@ -0,0 +1,31 @@
+// { dg-do assemble }
+
+struct
+Foo
+{
+public:
+ typedef void* (*copier_fn)(void const*);
+ void foo() const;
+ void bar(char const*, void const*) const;
+private:
+ struct
+ Bar
+ {
+ char const* key;
+ void const* item;
+ };
+};
+
+void
+Foo::foo() const
+{
+ Bar* cp = 0;
+ copier_fn copyfn = 0;
+
+ bar(cp->key, cp->item);
+ bar(cp->key, (copyfn) ? (*copyfn)(cp) : 0);
+ bar(cp->key, (copyfn) ? (*copyfn)(0) : 0);
+
+ bar(cp->key, (copyfn) ? (*copyfn)(0) : cp->item);
+ bar(cp->key, (copyfn) ? (*copyfn)(cp) : cp->item);
+}