summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2018-10-20 09:09:45 +0200
committerAkim Demaille <akim.demaille@gmail.com>2018-10-20 09:18:40 +0200
commitace93397c13910b5c25a72832efaadbdb0c428ff (patch)
treea71bd784bfec96c3390a2208420b2fe1db24a140
parentd2192653dbf555337464846e0132c547bf3a503a (diff)
downloadbison-ace93397c13910b5c25a72832efaadbdb0c428ff.tar.gz
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.
-rw-r--r--data/lalr1.cc13
-rw-r--r--data/variant.hh4
2 files changed, 9 insertions, 8 deletions
diff --git a/data/lalr1.cc b/data/lalr1.cc
index f80476db..7470ceda 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -333,7 +333,8 @@ m4_define([b4_shared_declarations],
stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) sym);
#if defined __cplusplus && __cplusplus < 201103L
/// 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
};
@@ -619,13 +620,13 @@ m4_if(b4_prefix, [yy], [],
#if defined __cplusplus && __cplusplus < 201103L
]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;
]b4_variant_if([b4_symbol_variant([that.type_get ()],
- [value], [move], [YY_MOVE (that.value)])],
- [[value = YY_MOVE (that.value);]])[]b4_locations_if([
- location = YY_MOVE (that.location);])[
+ [value], [move], [that.value])],
+ [[value = that.value;]])[]b4_locations_if([
+ location = that.location;])[
// that is emptied.
that.state = empty_state;
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)
{
#if defined __cplusplus && 201103L <= __cplusplus
- yypush_ (m, stack_symbol_type (s, YY_MOVE (sym)));
+ yypush_ (m, stack_symbol_type (s, std::move (sym)));
#else
stack_symbol_type ss (s, sym);
yypush_ (m, ss);
diff --git a/data/variant.hh b/data/variant.hh
index 66848fd2..f76d5d7f 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -184,7 +184,7 @@ m4_define([b4_variant_define],
{
build<T> ();
# if defined __cplusplus && 201103L <= __cplusplus
- as<T> () = YY_MOVE (other.as<T> ());
+ as<T> () = std::move (other.as<T> ());
# else
swap<T> (other);
# endif
@@ -198,7 +198,7 @@ m4_define([b4_variant_define],
move (self_type&& other)
{
build<T> ();
- as<T> () = YY_MOVE (other.as<T> ());
+ as<T> () = std::move (other.as<T> ());
other.destroy<T> ();
}
#endif