summaryrefslogtreecommitdiff
path: root/tests/local.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-06-08 22:05:03 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-06-09 08:36:01 +0200
commitd84b245c638e173f95286826cb6c3cd9598c43c5 (patch)
treeaf2ea007f6d761a59aae4b3fafdcfa06441efbbc /tests/local.at
parent73797b2552027868ef5eaa33c7d03f7ee04dca96 (diff)
downloadbison-d84b245c638e173f95286826cb6c3cd9598c43c5.tar.gz
tests: make sure the default action properly works in C++
See e3fdc370495ffdedadd6ac621e32e34a0e1a9de0: in C++ we generate explicitly the code for the default action instead of simply copying blindly the semantic value buffer. This is important when copying raw memory is not enough, as exemplified by move-only types. This is currently tested by examples/c++/variant.yy and variant-11.yy. But it is safer to also have a test in the main test suite. * tests/local.at (AT_REQUIRE_CXX_STD): Fix. (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS): Define/undefine AT_BISON_OPTIONS. * tests/c++.at (Default action): New.
Diffstat (limited to 'tests/local.at')
-rw-r--r--tests/local.at10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/local.at b/tests/local.at
index ee55efd6..63310901 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -137,7 +137,9 @@ m4_define([AT_BISON_OPTION_PUSHDEFS],
# inside macros, because issuing '[$1]' is not possible in M4 :(.
# This sucks hard, GNU M4 should really provide M5-like $$1.
m4_define([_AT_BISON_OPTION_PUSHDEFS],
-[m4_if([$1$2], $[1]$[2], [],
+[m4_pushdef([AT_BISON_OPTIONS], [$3])
+
+m4_if([$1$2], $[1]$[2], [],
[m4_fatal([$0: invalid arguments: $@])])dnl
m4_pushdef([AT_AUTOMOVE_IF],
[m4_bmatch([$3], [%define api\.value\.automove], [$1], [$2])])
@@ -306,7 +308,9 @@ AT_GLR_IF([AT_KEYWORDS([glr])])
# -----------------------
m4_define([AT_BISON_OPTION_POPDEFS],
[m4_divert_text([KILL],
-[m4_popdef([AT_YYLEX_PRE_ARGS])
+[m4_popdef([AT_BISON_OPTIONS])
+
+m4_popdef([AT_YYLEX_PRE_ARGS])
m4_popdef([AT_YYLEX_PRE_FORMALS])
m4_popdef([AT_USE_LEX_ARGS])
m4_popdef([AT_YYLEX_ARGS])
@@ -1126,7 +1130,7 @@ m4_ifval([$2],
[if test $at_status != 0; then
$2
fi],
- [SKIP_IF([test $at_status != 0])])
+ [AT_SKIP_IF([test $at_status != 0])])
])