]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
New test
authorMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 18 Apr 1998 01:12:22 +0000 (01:12 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sat, 18 Apr 1998 01:12:22 +0000 (01:12 +0000)
From-SVN: r19277

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

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 (file)
index 0000000..e713304
--- /dev/null
@@ -0,0 +1,19 @@
+// Build don't link:
+// Special g++ Options: -pedantic-errors
+
+void cheat( int* i ) { ++(*i); }
+struct t {
+        void cheat( int& i ) { ++i; }
+};
+
+int main()
+{
+  void (t::*member)( const int& ) = &t::cheat; // ERROR - conversion
+  void (*cheater)( const int* ) = &cheat; // ERROR - converting
+  t t2;
+  const int i=1;
+  int j=1;
+  (t2.*member)( i );
+  (t2.*member)( j );
+}