mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 10:13:03 +00:00
c++: privatize variant blind copies
* data/variant.hh (variant, operator=): Make private. * data/c++.m4 (operator=): New, to avoid needing a definition of that operator for each class member (such as a possible variant). * data/glr.cc, data/lalr.cc: Add the necessary include for the abort.
This commit is contained in:
11
data/c++.m4
11
data/c++.m4
@@ -186,6 +186,9 @@ m4_define([b4_public_types_declare],
|
||||
[const semantic_type& v],
|
||||
b4_locations_if([const location_type& l]))[);
|
||||
|
||||
/// Assignment operator.
|
||||
inline basic_symbol& operator= (const basic_symbol& other);
|
||||
|
||||
/// Destructive move, \a s is emptied.
|
||||
inline void move (basic_symbol& s);
|
||||
|
||||
@@ -250,6 +253,14 @@ m4_define([b4_public_types_define],
|
||||
, location (l)
|
||||
{}])[
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
]b4_parser_class_name[::basic_symbol<Base>&
|
||||
]b4_parser_class_name[::basic_symbol<Base>::operator= (const basic_symbol& other)
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
|
||||
template <typename Base>
|
||||
inline
|
||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
|
||||
|
||||
Reference in New Issue
Block a user