PR c++/92504
* semantics.c (handle_omp_for_class_iterator): Don't call
cp_fully_fold on cond.
* g++.dg/gomp/pr92504.C: New test.
From-SVN: r278433
+2019-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92504
+ * semantics.c (handle_omp_for_class_iterator): Don't call
+ cp_fully_fold on cond.
+
2019-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (cp_build_addr_expr_1): Use cp_expr_loc_or_input_loc
if (init && EXPR_HAS_LOCATION (init))
elocus = EXPR_LOCATION (init);
- cond = cp_fully_fold (cond);
switch (TREE_CODE (cond))
{
case GT_EXPR:
2019-11-19 Jakub Jelinek <jakub@redhat.com>
+ PR c++/92504
+ * g++.dg/gomp/pr92504.C: New test.
+
PR tree-optimization/92557
* gcc.dg/gomp/pr92557.c: New test.
--- /dev/null
+// PR c++/92504
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-O2" }
+
+namespace std {
+ typedef __SIZE_TYPE__ size_t;
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+}
+
+struct A {
+ A ();
+ A (const A &);
+ A & operator++ ();
+ bool operator != (const A &) const;
+ std::ptrdiff_t operator - (const A &);
+ A & operator += (std::size_t);
+ int a;
+ A & begin ();
+ A & end (); // { dg-message "declared here" }
+};
+
+void
+bar ()
+{
+ A a;
+ #pragma omp for
+ for (auto b = a; b != a.end; ++b) // { dg-error "invalid use of non-static member function" }
+ ;
+}