summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/temargs.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-10 16:21:46 +0000
committerTom Tromey <tromey@redhat.com>2011-06-10 16:21:46 +0000
commitf8fc126fca752b7f19a097c25e5a54a25eaa8d86 (patch)
tree3e6af0f2adab0114188c15069dfda78fe9c6f25f /gdb/testsuite/gdb.cp/temargs.cc
parent4e16eae2a7002565004ead34bd1536cc5ac31482 (diff)
downloadgdb-f8fc126fca752b7f19a097c25e5a54a25eaa8d86.tar.gz
* 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.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/temargs.cc b/gdb/testsuite/gdb.cp/temargs.cc
index a97486f1619..b7abef76dc9 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;
}