mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
c++: remove now-useless operators
Now that symbols behaves properly, we can eliminate special routines that are no longer needed. * data/c++.m4, data/glr.cc, data/lalr1.cc, data/variant.hh: Remove useless assignment operators and copy constructors. As a consequence, remove useless includes for "abort".
This commit is contained in:
22
data/c++.m4
22
data/c++.m4
@@ -171,9 +171,6 @@ m4_define([b4_public_types_declare],
|
|||||||
|
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
inline basic_symbol ();
|
inline basic_symbol ();
|
||||||
]b4_locations_if([
|
|
||||||
/// Constructor.
|
|
||||||
inline basic_symbol (const location_type& l);])[
|
|
||||||
|
|
||||||
/// Copy constructor.
|
/// Copy constructor.
|
||||||
inline basic_symbol (const basic_symbol& other);
|
inline basic_symbol (const basic_symbol& other);
|
||||||
@@ -188,8 +185,6 @@ m4_define([b4_public_types_declare],
|
|||||||
const location_type& l])[);
|
const location_type& l])[);
|
||||||
|
|
||||||
~basic_symbol ();
|
~basic_symbol ();
|
||||||
/// Assignment operator.
|
|
||||||
inline basic_symbol& operator= (const basic_symbol& other);
|
|
||||||
|
|
||||||
/// Destructive move, \a s is emptied into this.
|
/// Destructive move, \a s is emptied into this.
|
||||||
inline void move (basic_symbol& s);
|
inline void move (basic_symbol& s);
|
||||||
@@ -199,6 +194,10 @@ m4_define([b4_public_types_declare],
|
|||||||
|
|
||||||
/// The location.
|
/// The location.
|
||||||
location_type location;])[
|
location_type location;])[
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// Assignment operator.
|
||||||
|
basic_symbol& operator= (const basic_symbol& other);
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Type access provider for token (enum) based symbols.
|
/// Type access provider for token (enum) based symbols.
|
||||||
@@ -254,19 +253,6 @@ m4_define([b4_public_types_define],
|
|||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
|
||||||
: value ()
|
: value ()
|
||||||
{}
|
{}
|
||||||
]b4_locations_if([
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const location_type& l)
|
|
||||||
: value ()
|
|
||||||
, location (l)
|
|
||||||
{}])[
|
|
||||||
|
|
||||||
template <typename Base>
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>&
|
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::operator= (const basic_symbol&)
|
|
||||||
{
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Base>
|
template <typename Base>
|
||||||
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
|
]b4_parser_class_name[::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
|
||||||
|
|||||||
@@ -253,7 +253,6 @@ m4_define([b4_shared_declarations],
|
|||||||
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||||
b4_percent_code_get([[requires]])[
|
b4_percent_code_get([[requires]])[
|
||||||
|
|
||||||
#include <cstdlib> // abort
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>]b4_defines_if([
|
#include <iostream>]b4_defines_if([
|
||||||
|
|||||||
@@ -146,7 +146,6 @@ b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
|||||||
m4_define([b4_shared_declarations],
|
m4_define([b4_shared_declarations],
|
||||||
[b4_percent_code_get([[requires]])[
|
[b4_percent_code_get([[requires]])[
|
||||||
]b4_parse_assert_if([# include <cassert>])[
|
]b4_parse_assert_if([# include <cassert>])[
|
||||||
# include <cstdlib> // abort
|
|
||||||
# include <vector>
|
# include <vector>
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
# include <stdexcept>
|
# include <stdexcept>
|
||||||
@@ -308,6 +307,7 @@ b4_location_define])])[
|
|||||||
stack_symbol_type ();
|
stack_symbol_type ();
|
||||||
/// Steal the contents from \a sym to build this.
|
/// Steal the contents from \a sym to build this.
|
||||||
stack_symbol_type (state_type s, symbol_type& sym);
|
stack_symbol_type (state_type s, symbol_type& sym);
|
||||||
|
/// Assignment, needed by push_back.
|
||||||
stack_symbol_type& operator= (const stack_symbol_type& that);
|
stack_symbol_type& operator= (const stack_symbol_type& that);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ m4_map([ b4_symbol_tag_comment], [$@])dnl
|
|||||||
# The needed includes for variants support.
|
# The needed includes for variants support.
|
||||||
m4_define([b4_variant_includes],
|
m4_define([b4_variant_includes],
|
||||||
[b4_parse_assert_if([[#include <typeinfo>]])[
|
[b4_parse_assert_if([[#include <typeinfo>]])[
|
||||||
#include <cstdlib> // abort
|
|
||||||
#ifndef YYASSERT
|
#ifndef YYASSERT
|
||||||
# include <cassert>
|
# include <cassert>
|
||||||
# define YYASSERT assert
|
# define YYASSERT assert
|
||||||
@@ -213,19 +212,11 @@ m4_define([b4_variant_define],
|
|||||||
tname = YY_NULL;])[
|
tname = YY_NULL;])[
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Prohibit blind copies.
|
|
||||||
private:
|
|
||||||
self_type& operator=(const self_type&)
|
|
||||||
{
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
|
|
||||||
variant (const self_type&)
|
|
||||||
{
|
|
||||||
abort ();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
/// Prohibit blind copies.
|
||||||
|
self_type& operator=(const self_type&);
|
||||||
|
variant (const self_type&);
|
||||||
|
|
||||||
/// A buffer large enough to store any of the semantic values.
|
/// A buffer large enough to store any of the semantic values.
|
||||||
/// Long double is chosen as it has the strongest alignment
|
/// Long double is chosen as it has the strongest alignment
|
||||||
/// constraints.
|
/// constraints.
|
||||||
|
|||||||
Reference in New Issue
Block a user