]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++/modules: stream PTRMEM_CST_LOCATION and TRAIT_EXPR_LOCATION
authorPatrick Palka <ppalka@redhat.com>
Thu, 23 Apr 2026 22:31:56 +0000 (18:31 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 23 Apr 2026 22:31:56 +0000 (18:31 -0400)
gcc/cp/ChangeLog:

* module.cc (trees_out::core_vals) <case PTRMEM_CST>:
Stream PTRMEM_CST_LOCATION.
<case TRAIT_EXPR>: Stream TRAIT_EXPR_LOCATION.
(trees_in::core_vals): As in trees_out::core_vals.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/module.cc

index 101b4fde74f9b29a48d40895c5e46673ffa51ff3..091031798dc823c02e124b5116c50709da7d99f7 100644 (file)
@@ -6872,6 +6872,8 @@ trees_out::core_vals (tree t)
 
     case PTRMEM_CST:
       WT (((lang_tree_node *)t)->ptrmem.member);
+      if (state)
+       state->write_location (*this, ((lang_tree_node *)t)->ptrmem.locus);
       break;
 
     case STATIC_ASSERT:
@@ -6933,6 +6935,9 @@ trees_out::core_vals (tree t)
     case TRAIT_EXPR:
       WT (((lang_tree_node *)t)->trait_expression.type1);
       WT (((lang_tree_node *)t)->trait_expression.type2);
+      if (state)
+       state->write_location
+         (*this, ((lang_tree_node *)t)->trait_expression.locus);
       if (streaming_p ())
        WU (((lang_tree_node *)t)->trait_expression.kind);
       break;
@@ -7444,6 +7449,7 @@ trees_in::core_vals (tree t)
 
     case PTRMEM_CST:
       RTU (((lang_tree_node *)t)->ptrmem.member);
+      ((lang_tree_node *)t)->ptrmem.locus = state->read_location (*this);
       break;
 
     case STATIC_ASSERT:
@@ -7493,6 +7499,8 @@ trees_in::core_vals (tree t)
     case TRAIT_EXPR:
       RT (((lang_tree_node *)t)->trait_expression.type1);
       RT (((lang_tree_node *)t)->trait_expression.type2);
+      ((lang_tree_node *)t)->trait_expression.locus
+       = state->read_location (*this);
       RUC (cp_trait_kind, ((lang_tree_node *)t)->trait_expression.kind);
       break;