PR c++/59297
* semantics.c (finish_omp_atomic): Call finish_expr_stmt
rather than add_stmt.
* g++.dg/gomp/pr59297.C: New test.
From-SVN: r205500
+2013-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/59297
+ * semantics.c (finish_omp_atomic): Call finish_expr_stmt
+ rather than add_stmt.
+
2013-11-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++spec.c (TIMELIB): Define.
stmt = build2 (OMP_ATOMIC, void_type_node, integer_zero_node, stmt);
OMP_ATOMIC_SEQ_CST (stmt) = seq_cst;
}
- add_stmt (stmt);
+ finish_expr_stmt (stmt);
}
void
+2013-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/59297
+ * g++.dg/gomp/pr59297.C: New test.
+
2013-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/57293
--- /dev/null
+// PR c++/59297
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+template <typename T>
+struct A
+{
+ ~A ();
+ const T &operator[] (int) const;
+};
+
+struct B
+{
+ int &operator () (A <int>);
+};
+
+void
+foo (B &x, int &z)
+{
+ A<A<int> > y;
+ #pragma omp atomic
+ x (y[0]) += 1;
+ #pragma omp atomic
+ z += x(y[1]);
+}