PR c/84721
* c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if
!building_stmt_list_p ().
* gcc.dg/pr84721.c: New test.
From-SVN: r258302
+2018-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/84721
+ * c-parser.c (add_debug_begin_stmt): Don't add DEBUG_BEGIN_STMT if
+ !building_stmt_list_p ().
+
2018-02-13 Richard Sandiford <richard.sandiford@linaro.org>
PR c/84305
static void
add_debug_begin_stmt (location_t loc)
{
- if (!MAY_HAVE_DEBUG_MARKER_STMTS)
+ /* Don't add DEBUG_BEGIN_STMTs outside of functions, see PR84721. */
+ if (!MAY_HAVE_DEBUG_MARKER_STMTS || !building_stmt_list_p ())
return;
tree stmt = build0 (DEBUG_BEGIN_STMT, void_type_node);
2018-03-06 Jakub Jelinek <jakub@redhat.com>
+ PR c/84721
+ * gcc.dg/pr84721.c: New test.
+
PR target/84710
* gcc.dg/pr84710.c: New test.
--- /dev/null
+/* PR c/84721 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2" } */
+
+int a[({ int b })]; /* { dg-error "braced-group within expression allowed only inside a function" } */
+int c[({ int d () {}; })]; /* { dg-error "braced-group within expression allowed only inside a function" } */