summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/conv2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/conv2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/conv2.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/conv2.C b/gcc/testsuite/g++.old-deja/g++.other/conv2.C
new file mode 100644
index 000000000..56e41039e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv2.C
@@ -0,0 +1,19 @@
+// { dg-do assemble }
+// { dg-options "-pedantic-errors" }
+
+void cheat( int* i ) { ++(*i); }
+
+struct t {
+ void cheat( int& i ) { ++i; }
+};
+
+int main()
+{
+ void (t::*member)( const int& ) = &t::cheat; // { dg-error "" } conversion
+ void (*cheater)( const int* ) = &cheat; // { dg-error "" } converting
+ t t2;
+ const int i=1;
+ int j=1;
+ (t2.*member)( i );
+ (t2.*member)( j );
+}