+2019-10-23 Jakub Jelinek <jakub@redhat.com>
+
+ * constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>:
+ Temporarily change input_location to CLEANUP_STMT location.
+
2019-10-22 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/85887
non_constant_p, overflow_p,
jump_target);
if (!CLEANUP_EH_ONLY (t) && !*non_constant_p)
- /* Also evaluate the cleanup. If we weren't skipping at the
- start of the CLEANUP_BODY, change jump_target temporarily
- to &initial_jump_target, so that even a return or break or
- continue in the body doesn't skip the cleanup. */
- cxx_eval_constant_expression (ctx, CLEANUP_EXPR (t), true,
- non_constant_p, overflow_p,
- jump_target ? &initial_jump_target
- : NULL);
+ {
+ location_t loc = input_location;
+ if (EXPR_HAS_LOCATION (t))
+ input_location = EXPR_LOCATION (t);
+ /* Also evaluate the cleanup. If we weren't skipping at the
+ start of the CLEANUP_BODY, change jump_target temporarily
+ to &initial_jump_target, so that even a return or break or
+ continue in the body doesn't skip the cleanup. */
+ cxx_eval_constant_expression (ctx, CLEANUP_EXPR (t), true,
+ non_constant_p, overflow_p,
+ jump_target ? &initial_jump_target
+ : NULL);
+ input_location = loc;
+ }
}
break;
+2019-10-23 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/cpp2a/constexpr-dtor3.C: Expect in 'constexpr' expansion of
+ message on the line with variable declaration.
+ * g++.dg/ext/constexpr-attr-cleanup1.C: Likewise.
+
2019-10-23 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20191023-1.c: New test.