mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user