diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C new file mode 100644 index 0000000..a389f66 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for8.C @@ -0,0 +1,15 @@ +// Test for range-based for loop when the declarator declares +// a new type + +// { dg-do compile { target c++11 } } + +#include <initializer_list> + +void test() +{ + for (struct S { } *x : { (S*)0, (S*)0 } ) + ; + + for (struct S { } x : { S(), S() } ) + ; +} |