aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C
new file mode 100644
index 0000000..1397830
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/range-for10.C
@@ -0,0 +1,18 @@
+// PR c++/47388
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-for-scope" }
+
+template <int>
+void
+foo ()
+{
+ int a[] = { 1, 2, 3, 4 };
+ for (int i : a)
+ ;
+}
+
+void
+bar ()
+{
+ foo <0> ();
+}