diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/pmf3.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/pmf3.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/pmf3.C b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C new file mode 100644 index 000000000..11e648ed8 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/pmf3.C @@ -0,0 +1,26 @@ +// { dg-do assemble } +// Submitted by Nathan Sidwell <nathan@acm.org> +// Bug: g++ was crashing after giving errors. + +template<class T> + void connect_to_method( // { dg-message "connect_to_method|no known conversion" } + T *receiver, + void (T::*method)()) + {} + +class Gtk_Base +{ +public: + void expose(); + void show(); + void show(int); + Gtk_Base(); +}; + + +Gtk_Base::Gtk_Base() +{ + connect_to_method(this,&show); // { dg-error "no match" } invalid pmf expression + // { dg-message "candidate" "candidate note" { target *-*-* } 23 } + connect_to_method(this,&expose); // { dg-error "pointer to member" } invalid pmf expression +} |