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