summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/tpl-for-3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/gomp/tpl-for-3.C')
-rw-r--r--gcc/testsuite/g++.dg/gomp/tpl-for-3.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/gomp/tpl-for-3.C b/gcc/testsuite/g++.dg/gomp/tpl-for-3.C
new file mode 100644
index 000000000..0cafd9628
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/tpl-for-3.C
@@ -0,0 +1,28 @@
+// { dg-do compile }
+
+void foo(int);
+
+template<typename T> void bar()
+{
+ #pragma omp parallel for
+ for (typename T::T i = 0; i < T::N; ++i)
+ foo(i);
+}
+
+struct A
+{
+ typedef int T;
+ static T N;
+};
+
+struct B
+{
+ typedef long T;
+ static T N;
+};
+
+void test()
+{
+ bar<A>();
+ bar<B>();
+}