re PR c++/77578 (ICE in cp_parser_omp_for_loop (cp/parser.c:29404))
authorJakub Jelinek <jakub@redhat.com>
Tue, 10 Oct 2017 20:09:29 +0000 (22:09 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 10 Oct 2017 20:09:29 +0000 (22:09 +0200)
PR c++/77578
* g++.dg/gomp/pr77578.C: New test.

From-SVN: r253612

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr77578.C [new file with mode: 0644]

index 3d7a5348493c10c48a2c6c0692e06441a6591725..7e52744c9f27f5a77a34ce995c9681cc07173638 100644 (file)
@@ -1,5 +1,8 @@
 2017-10-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR c++/77578
+       * g++.dg/gomp/pr77578.C: New test.
+
        PR middle-end/70100
        * g++.dg/opt/pr70100.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/gomp/pr77578.C b/gcc/testsuite/g++.dg/gomp/pr77578.C
new file mode 100644 (file)
index 0000000..d92fddf
--- /dev/null
@@ -0,0 +1,31 @@
+// PR c++/77578
+// { dg-do compile }
+
+template <typename T>
+class A 
+{
+};
+
+template <typename T>
+struct B
+{
+};
+
+template <typename T>
+struct B <A <T> >
+{
+  typedef A <T> C;
+  typedef typename C::D D;
+  template <typename U>
+  static void
+  foo (const D x, const D y)
+  {
+    U u;
+    {
+      #pragma omp parallel for 
+      for (u.bar().y() = x.y(); u.bar().y() <= y.y(); u.bar().y()++) // { dg-error "expected" }
+       ;
+    }
+  }
+};