https://gcc.gnu.org/g:dc45c079d91fc1b991f63e6c65637f26a866fa88

commit r16-4759-gdc45c079d91fc1b991f63e6c65637f26a866fa88
Author: Pierre-Emmanuel Patry <[email protected]>
Date:   Tue Aug 5 11:45:00 2025 +0200

    gccrs: Copy cfg_attrs instead setting it to itself
    
    CfgAttribute copy constructor did not copy cfg_attrs properly.
    
    gcc/rust/ChangeLog:
    
            * ast/rust-cond-compilation.h: Copy cfg_attrs
    
    Signed-off-by: Pierre-Emmanuel Patry <[email protected]>

Diff:
---
 gcc/rust/ast/rust-cond-compilation.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/ast/rust-cond-compilation.h 
b/gcc/rust/ast/rust-cond-compilation.h
index 56a5646704a8..4beb33768d60 100644
--- a/gcc/rust/ast/rust-cond-compilation.h
+++ b/gcc/rust/ast/rust-cond-compilation.h
@@ -226,7 +226,7 @@ public:
   CfgAttrAttribute (CfgAttrAttribute const &other)
     : config_to_include (
       other.config_to_include->clone_configuration_predicate ()),
-      cfg_attrs (cfg_attrs)
+      cfg_attrs (other.cfg_attrs)
   {}
 
   // Overloaded assignment operator to clone

Reply via email to