diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/inherit/ptrmem1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/inherit/ptrmem1.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/inherit/ptrmem1.C b/gcc/testsuite/g++.dg/inherit/ptrmem1.C new file mode 100644 index 000000000..375efc811 --- /dev/null +++ b/gcc/testsuite/g++.dg/inherit/ptrmem1.C @@ -0,0 +1,21 @@ +// PR c++/14803 +// { dg-options "-Werror" } + +struct sc_module { int member; }; + +struct sc_signal_in_if { bool state; }; + +typedef void (sc_module::*SC_ENTRY_FUNC)(); + +class sc_clock : public sc_signal_in_if, public sc_module +{ +public: + sc_clock(); + void posedge_action(); + SC_ENTRY_FUNC fptr; +}; + +sc_clock::sc_clock() +{ + fptr = static_cast<SC_ENTRY_FUNC>(&sc_clock::posedge_action); +} |