diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/pr70869.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr70869.C | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr70869.C b/gcc/testsuite/g++.dg/cpp0x/pr70869.C new file mode 100644 index 0000000000..84c532b677 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr70869.C @@ -0,0 +1,25 @@ +// PR c++/70869 +// { dg-do run { target c++11 } } + +#include <initializer_list> + +struct A +{ + int f () { return 1; } + int g () { return 2; } + int h () { return 3; } +}; + +int +main () +{ + int cnt = 0; + for (const auto &m : { &A::f, &A::g, &A::h }) + { + A a; + if ((a.*m) () != ++cnt) + __builtin_abort (); + } + if (cnt != 3) + __builtin_abort (); +} |