diff options
author | Tom Tromey <tromey@redhat.com> | 2011-06-10 16:21:47 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-06-10 16:21:47 +0000 |
commit | d0e53741e00a0b5a4555217337f0faeaa77dd71a (patch) | |
tree | f42845dd37f57488c56a41031fbcf201533065f9 /gdb/testsuite/gdb.cp/temargs.cc | |
parent | 894891db7f1ff09f021a0d2c8bb471f3a73a776a (diff) | |
download | gdb-d0e53741e00a0b5a4555217337f0faeaa77dd71a.zip gdb-d0e53741e00a0b5a4555217337f0faeaa77dd71a.tar.gz gdb-d0e53741e00a0b5a4555217337f0faeaa77dd71a.tar.bz2 |
* gdb.cp/temargs.exp: Let tests pass if compiler bug is fixed.
Add tests for pointer-to-member-function.
* gdb.cp/temargs.cc (S::somefunc): New function.
(K2): New class.
(main): Instantiate K2; call method.
Diffstat (limited to 'gdb/testsuite/gdb.cp/temargs.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/temargs.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/temargs.cc b/gdb/testsuite/gdb.cp/temargs.cc index a97486f..b7abef7 100644 --- a/gdb/testsuite/gdb.cp/temargs.cc +++ b/gdb/testsuite/gdb.cp/temargs.cc @@ -23,6 +23,7 @@ int a_global; struct S { int f; + void somefunc() { } }; template<typename T, int I, int *P, int S::*MP> @@ -55,17 +56,28 @@ void func () // Breakpoint 3. } +template<void (S::*F) ()> +struct K2 +{ + void k2_m () + { + // Breakpoint 5. + } +}; + int main () { Base<double, 23, &a_global, &S::f> base; // Note that instantiating with P==0 does not work with g++. // That would be worth testing, once g++ is fixed. Base<long, 47, &a_global, &S::f>::Inner<float> inner; + K2<&S::somefunc> k2; base.base_m (); inner.inner_m (); func<unsigned char, 91, &a_global, &S::f> (); base.templ_m<short> (); + k2.k2_m (); return 0; } |