aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>1998-04-18 01:12:22 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-04-18 01:12:22 +0000
commitf4c81730d81f5899761de6895da0c845153bc095 (patch)
tree6a0a40ec8554df1be0509f366381141a9d245d31 /gcc
parentea8693a4363bb692d5d69cc77ec134b93d6dab22 (diff)
downloadgcc-f4c81730d81f5899761de6895da0c845153bc095.zip
gcc-f4c81730d81f5899761de6895da0c845153bc095.tar.gz
gcc-f4c81730d81f5899761de6895da0c845153bc095.tar.bz2
New test
From-SVN: r19277
Diffstat (limited to 'gcc')
-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 0000000..e713304
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/conv2.C
@@ -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 );
+}