[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sr #110032] For C++98 stack_symbol_type defines only non-const oper
From: |
Akim Demaille |
Subject: |
Re: [sr #110032] For C++98 stack_symbol_type defines only non-const operator= |
Date: |
Sat, 28 Sep 2019 08:11:35 +0200 |
I pushed this in maint, and merge it in master. Thanks!
commit 406e8c7c02daf1b74eeacf9831763ceec128ab9b
Author: Akim Demaille <address@hidden>
Date: Wed Sep 25 19:34:34 2019 +0200
c++: add copy ctors for compatibility with the IAR compiler
Reported by Andreas Damm.
https://savannah.gnu.org/support/?110032
* data/skeletons/lalr1.cc (stack_symbol_type::operator=): New
overload, const, to please the IAR C++ compiler (version ca 2013).
diff --git a/THANKS b/THANKS
index 4d2b25f7..2cdd9b0b 100644
--- a/THANKS
+++ b/THANKS
@@ -10,6 +10,7 @@ Albert Chin-A-Young address@hidden
Alexander Belopolsky address@hidden
Alexandre Duret-Lutz address@hidden
Andre da Costa Barros address@hidden
+Andreas Damm address@hidden
Andreas Schwab address@hidden
Andrew Suffield address@hidden
Angelo Borsotti address@hidden
diff --git a/data/skeletons/lalr1.cc b/data/skeletons/lalr1.cc
index d1c30403..3e1ac445 100644
--- a/data/skeletons/lalr1.cc
+++ b/data/skeletons/lalr1.cc
@@ -335,6 +335,10 @@ m4_define([b4_shared_declarations],
/// Assignment, needed by push_back by some old implementations.
/// Moves the contents of that.
stack_symbol_type& operator= (stack_symbol_type& that);
+
+ /// Assignment, needed by push_back by other implementations.
+ /// Needed by some other old implementations.
+ stack_symbol_type& operator= (const stack_symbol_type& that);
#endif
};
@@ -627,6 +631,17 @@ m4_if(b4_prefix, [yy], [],
}
#if YY_CPLUSPLUS < 201103L
+ ]b4_parser_class[::stack_symbol_type&
+ ]b4_parser_class[::stack_symbol_type::operator= (const stack_symbol_type&
that)
+ {
+ state = that.state;
+ ]b4_variant_if([b4_symbol_variant([that.type_get ()],
+ [value], [copy], [that.value])],
+ [[value = that.value;]])[]b4_locations_if([
+ location = that.location;])[
+ return *this;
+ }
+
]b4_parser_class[::stack_symbol_type&
]b4_parser_class[::stack_symbol_type::operator= (stack_symbol_type& that)
{