c++: check that emplace for rvalues works

See the previous commit.

* tests/local.at (AT_REQUIRE_CXX_VERSION): New.
* tests/types.at (api.value.type): Check emplace in C++14.
This commit is contained in:
Akim Demaille
2018-10-20 19:42:25 +02:00
parent 3ead69b1c1
commit 07a4b32f4d
2 changed files with 70 additions and 18 deletions

View File

@@ -138,7 +138,7 @@ m4_define([AT_BISON_OPTION_PUSHDEFS],
# This sucks hard, GNU M4 should really provide M5-like $$1.
m4_define([_AT_BISON_OPTION_PUSHDEFS],
[m4_if([$1$2], $[1]$[2], [],
[m4_fatal([$0: Invalid arguments: $@])])dnl
[m4_fatal([$0: invalid arguments: $@])])dnl
m4_pushdef([AT_AUTOMOVE_IF],
[m4_bmatch([$3], [%define api\.value\.automove], [$1], [$2])])
m4_pushdef([AT_DEFINES_IF],
@@ -904,6 +904,33 @@ AT_PARSER_CHECK([./c-and-cxx])
])
# AT_REQUIRE_CXX_VERSION(STD)
# ---------------------------
# Skip unless this compiler supports at least C++ STD (e.g., "11",
# "14", etc.).
m4_define([AT_REQUIRE_CXX_VERSION],
[AT_DATA([check.cc],
[[int main ()
{
#if __cplusplus < ]m4_case([$1],
[98], [199711],
[03], [199711],
[11], [201103],
[14], [201402],
[17], [201703],
[2a], [201709],
[m4_fatal([$0: invalid arguments: $@])])[
return 77;
#else
return 0;
#endif
}
]])
AT_COMPILE_CXX([check])
AT_CHECK([@&t@./check])
])
# AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR
# ------------------------------------
# Check that we can expect exceptions to be handled properly.