diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr49615.C')
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr49615.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr49615.C b/gcc/testsuite/g++.dg/torture/pr49615.C new file mode 100644 index 000000000..98a2f95b8 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr49615.C @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-g" } */ + +template <class T> +static inline bool Dispatch (T* obj, void (T::*func) ()) +{ + (obj->*func) (); +} +class C +{ + bool f (int); + void g (); +}; +bool C::f (int n) +{ + bool b; + switch (n) + { + case 0: + b = Dispatch (this, &C::g); + case 1: + b = Dispatch (this, &C::g); + } +} +void C::g () +{ + for (;;) { } +} + |