]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: modules and debug marker stmts
authorJason Merrill <jason@redhat.com>
Wed, 20 Nov 2024 09:43:30 +0000 (10:43 +0100)
committerJason Merrill <jason@redhat.com>
Thu, 21 Nov 2024 18:37:23 +0000 (19:37 +0100)
21_strings/basic_string/operations/contains/nonnull.cc was failing because
the module was built with debug markers and the testcase was built not
expecting debug markers, so we crashed in lower_stmt.  Let's accommodate
this by discarding debug marker statements we don't want.

gcc/cp/ChangeLog:

* module.cc (trees_in::core_vals) [STATEMENT_LIST]: Skip
DEBUG_BEGIN_STMT if !MAY_HAVE_DEBUG_MARKER_STMTS.

gcc/cp/module.cc

index 4136fdceb9f6020647f9d8d8c4347642289bf355..3b25f9569280f784360f3c97fea1d8e7f467af0b 100644 (file)
@@ -6895,7 +6895,12 @@ trees_in::core_vals (tree t)
       {
        tree_stmt_iterator iter = tsi_start (t);
        for (tree stmt; RT (stmt);)
-         tsi_link_after (&iter, stmt, TSI_CONTINUE_LINKING);
+         {
+           if (TREE_CODE (stmt) == DEBUG_BEGIN_STMT
+               && !MAY_HAVE_DEBUG_MARKER_STMTS)
+             continue;
+           tsi_link_after (&iter, stmt, TSI_CONTINUE_LINKING);
+         }
       }
       break;