aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-11-20 10:43:30 +0100
committerJason Merrill <jason@redhat.com>2024-11-21 19:37:23 +0100
commit74498be0e6041d2abcd17cf2c0eed6cb034ce6a3 (patch)
treeef20350766443fecef8705f323ceeb02d99a54c4
parent03c7145a4175c452362b5d1e2fa5f83dc8a01d18 (diff)
downloadgcc-74498be0e6041d2abcd17cf2c0eed6cb034ce6a3.zip
gcc-74498be0e6041d2abcd17cf2c0eed6cb034ce6a3.tar.gz
gcc-74498be0e6041d2abcd17cf2c0eed6cb034ce6a3.tar.bz2
c++: modules and debug marker stmts
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.
-rw-r--r--gcc/cp/module.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 4136fdc..3b25f95 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -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;