c++: also provide a copy constructor for symbol_type

Suggested by Wolfgang Thaller.
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00081.html

* data/c++.m4 (basic_symbol, by_type): Instead of provide either move
or copy constructor, always provide the copy one.
* tests/c++.at (C++ Variant-based Symbols Unit Tests): Check it.
This commit is contained in:
Akim Demaille
2018-12-24 08:19:01 +01:00
parent 807bf60cfc
commit 10591c8879
3 changed files with 49 additions and 11 deletions

View File

@@ -171,6 +171,14 @@ int main()
}
#endif
// symbol_type: copy constructor.
{
parser::symbol_type s = parser::make_INT (51);
parser::symbol_type s2 = s;
assert_eq (s.value.as<int> (), 51);
assert_eq (s2.value.as<int> (), 51);
}
// stack_symbol_type: construction, accessor.
{
#if 201103L <= YY_CPLUSPLUS