[gcc r14-7335] gccrs: Add missing node_id copys in the copy constructors

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 17:23:14 GMT 2024


https://gcc.gnu.org/g:10c4a2ce03c99c1394e9d610c0f38ce990284181

commit r14-7335-g10c4a2ce03c99c1394e9d610c0f38ce990284181
Author: Philip Herron <herron.philip@googlemail.com>
Date:   Fri Mar 3 17:59:00 2023 +0000

    gccrs: Add missing node_id copys in the copy constructors
    
    Signed-off-by: Philip Herron <herron.philip@googlemail.com>
    
    gcc/rust/ChangeLog:
    
            * ast/rust-path.h: add missing copy for node_id

Diff:
---
 gcc/rust/ast/rust-path.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/rust/ast/rust-path.h b/gcc/rust/ast/rust-path.h
index 84c64b24c60..0b9c280f333 100644
--- a/gcc/rust/ast/rust-path.h
+++ b/gcc/rust/ast/rust-path.h
@@ -1046,6 +1046,7 @@ public:
     : has_opening_scope_resolution (other.has_opening_scope_resolution),
       locus (other.locus)
   {
+    node_id = other.node_id;
     segments.reserve (other.segments.size ());
     for (const auto &e : other.segments)
       segments.push_back (e->clone_type_path_segment ());
@@ -1054,6 +1055,7 @@ public:
   // Overloaded assignment operator with clone
   TypePath &operator= (TypePath const &other)
   {
+    node_id = other.node_id;
     has_opening_scope_resolution = other.has_opening_scope_resolution;
     locus = other.locus;


More information about the Gcc-cvs mailing list