+2013-10-09 Marek Polacek <polacek@redhat.com>
+
+ PR c++/58635
+ * semantics.c (finish_return_stmt): Return error_mark_node
+ when error_operand_p of the expr is true.
+ (build_transaction_expr): Check for EXPR_P before setting the
+ expr location.
+
2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58568
expr = check_return_expr (expr, &no_warning);
- if (flag_openmp && !check_omp_return ())
+ if (error_operand_p (expr)
+ || (flag_openmp && !check_omp_return ()))
return error_mark_node;
if (!processing_template_decl)
{
if (noex)
{
expr = build_must_not_throw_expr (expr, noex);
- SET_EXPR_LOCATION (expr, loc);
+ if (EXPR_P (expr))
+ SET_EXPR_LOCATION (expr, loc);
TREE_SIDE_EFFECTS (expr) = 1;
}
ret = build1 (TRANSACTION_EXPR, TREE_TYPE (expr), expr);
+2013-10-09 Marek Polacek <polacek@redhat.com>
+
+ PR c++/58635
+ * g++.dg/tm/pr58635-1.C: New test.
+ * g++.dg/tm/pr58635-2.C: New test.
+
2013-10-09 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/vect/bb-slp-31.c: Add cleanup-tree-dump.
--- /dev/null
+// { dg-do compile }
+// { dg-options "-std=c++11 -fgnu-tm" }
+
+int
+foo (void)
+{
+ return __transaction_atomic noexcept(false) (false);
+}
+
+int
+bar (int i)
+{
+ return __transaction_atomic noexcept(false) (i);
+}
--- /dev/null
+// { dg-do compile }
+// { dg-options "-std=c++11 -fgnu-tm" }
+
+int
+foo (void)
+{
+ return __transaction_atomic noexcept(false) (x); // { dg-error "was not declared in this scope" }
+}