mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: introduce api.value.automove
Based on work by Frank Heckenbach. See http://lists.gnu.org/archive/html/bug-bison/2018-04/msg00000.html and http://lists.gnu.org/archive/html/bug-bison/2018-09/msg00019.html. * data/lalr1.cc (b4_rhs_value): Use YY_MOVE api.rhs.automove is set. * doc/bison.texi (%define Summary): Document api.rhs.automove. * examples/variant-11.yy: Use it. * tests/local.at (AT_AUTOMOVE_IF): New. * tests/c++.at (Variants): Check move semantics.
This commit is contained in:
@@ -83,9 +83,14 @@ m4_define([b4_rhs_state],
|
||||
# --------------------------------------
|
||||
# Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
|
||||
# symbols on RHS.
|
||||
m4_define([b4_rhs_value],
|
||||
m4_define([_b4_rhs_value],
|
||||
[b4_symbol_value([b4_rhs_data([$1], [$2]).value], [$3])])
|
||||
|
||||
m4_define([b4_rhs_value],
|
||||
[b4_percent_define_ifdef([api.value.automove],
|
||||
[YY_MOVE(_b4_rhs_value($@))],
|
||||
[_b4_rhs_value($@)])])
|
||||
|
||||
|
||||
# b4_rhs_location(RULE-LENGTH, NUM)
|
||||
# ---------------------------------
|
||||
|
||||
Reference in New Issue
Block a user