mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 02:33:03 +00:00
c++: don't obfuscate std::move when not needed
* data/lalr1.cc, data/variant.hh: Avoid macros that depend on the version of C++ when not needed.
This commit is contained in:
@@ -333,7 +333,8 @@ m4_define([b4_shared_declarations],
|
|||||||
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if defined __cplusplus && __cplusplus < 201103L
|
||||||
/// Assignment, needed by push_back by some old implementations.
|
/// Assignment, needed by push_back by some old implementations.
|
||||||
stack_symbol_type& operator= (YY_MOVE_REF (stack_symbol_type) that);
|
/// Moves the contents of that.
|
||||||
|
stack_symbol_type& operator= (stack_symbol_type& that);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -619,13 +620,13 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
|
|
||||||
#if defined __cplusplus && __cplusplus < 201103L
|
#if defined __cplusplus && __cplusplus < 201103L
|
||||||
]b4_parser_class_name[::stack_symbol_type&
|
]b4_parser_class_name[::stack_symbol_type&
|
||||||
]b4_parser_class_name[::stack_symbol_type::operator= (YY_MOVE_REF (stack_symbol_type) that)
|
]b4_parser_class_name[::stack_symbol_type::operator= (stack_symbol_type& that)
|
||||||
{
|
{
|
||||||
state = that.state;
|
state = that.state;
|
||||||
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
]b4_variant_if([b4_symbol_variant([that.type_get ()],
|
||||||
[value], [move], [YY_MOVE (that.value)])],
|
[value], [move], [that.value])],
|
||||||
[[value = YY_MOVE (that.value);]])[]b4_locations_if([
|
[[value = that.value;]])[]b4_locations_if([
|
||||||
location = YY_MOVE (that.location);])[
|
location = that.location;])[
|
||||||
// that is emptied.
|
// that is emptied.
|
||||||
that.state = empty_state;
|
that.state = empty_state;
|
||||||
return *this;
|
return *this;
|
||||||
@@ -676,7 +677,7 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
]b4_parser_class_name[::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
|
||||||
{
|
{
|
||||||
#if defined __cplusplus && 201103L <= __cplusplus
|
#if defined __cplusplus && 201103L <= __cplusplus
|
||||||
yypush_ (m, stack_symbol_type (s, YY_MOVE (sym)));
|
yypush_ (m, stack_symbol_type (s, std::move (sym)));
|
||||||
#else
|
#else
|
||||||
stack_symbol_type ss (s, sym);
|
stack_symbol_type ss (s, sym);
|
||||||
yypush_ (m, ss);
|
yypush_ (m, ss);
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ m4_define([b4_variant_define],
|
|||||||
{
|
{
|
||||||
build<T> ();
|
build<T> ();
|
||||||
# if defined __cplusplus && 201103L <= __cplusplus
|
# if defined __cplusplus && 201103L <= __cplusplus
|
||||||
as<T> () = YY_MOVE (other.as<T> ());
|
as<T> () = std::move (other.as<T> ());
|
||||||
# else
|
# else
|
||||||
swap<T> (other);
|
swap<T> (other);
|
||||||
# endif
|
# endif
|
||||||
@@ -198,7 +198,7 @@ m4_define([b4_variant_define],
|
|||||||
move (self_type&& other)
|
move (self_type&& other)
|
||||||
{
|
{
|
||||||
build<T> ();
|
build<T> ();
|
||||||
as<T> () = YY_MOVE (other.as<T> ());
|
as<T> () = std::move (other.as<T> ());
|
||||||
other.destroy<T> ();
|
other.destroy<T> ();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user