summaryrefslogtreecommitdiff
path: root/data/variant.hh
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2018-08-31 07:20:53 +0200
committerAkim Demaille <akim.demaille@gmail.com>2018-08-31 07:25:57 +0200
commit50fb43468970d5a582a08f7e24e01619795089bb (patch)
treefa4d6633539cbd3a49dd99cb1e029d6f09ce1c1d /data/variant.hh
parentb5d4eb8913c762de9115aecc2926f70b35b11930 (diff)
downloadbison-50fb43468970d5a582a08f7e24e01619795089bb.tar.gz
C++: leave 'inline' on the definition, not the declaration
This is for consistency with the other uses of 'inline' in the C++ skeletons. On examples/variant.yy, this change gives: --- examples/variant.hh 2018-08-31 07:16:57.214222580 +0200 +++ examples/variant.hh 2018-08-31 07:19:52.285431997 +0200 @@ -444,15 +444,15 @@ typedef basic_symbol<by_type> symbol_type; // Symbol constructors declarations. - static inline + static symbol_type make_END_OF_FILE (const location_type& l); - static inline + static symbol_type make_TEXT (const ::std::string& v, const location_type& l); - static inline + static symbol_type make_NUMBER (const int& v, const location_type& l); @@ -945,19 +945,23 @@ }; return static_cast<token_type> (yytoken_number_[type]); } + // Implementation of make_symbol for each symbol type. + inline parser::symbol_type parser::make_END_OF_FILE (const location_type& l) { return symbol_type (token::END_OF_FILE, l); } + inline parser::symbol_type parser::make_TEXT (const ::std::string& v, const location_type& l) { return symbol_type (token::TEXT, v, l); } + inline parser::symbol_type parser::make_NUMBER (const int& v, const location_type& l) { @@ -967,7 +971,7 @@ } // yy -#line 971 "examples/variant.hh" // lalr1.cc:380 +#line 975 "examples/variant.hh" // lalr1.cc:380 and no changes on variant.cc. * data/c++.m4 (b4_public_types_define): Formatting changes. * data/variant.hh (b4_symbol_value_template_, b4_symbol_constructor_declare_): Move the 'inline' from declaration to implementation.
Diffstat (limited to 'data/variant.hh')
-rw-r--r--data/variant.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/data/variant.hh b/data/variant.hh
index 8d0f06f6..a4db750a 100644
--- a/data/variant.hh
+++ b/data/variant.hh
@@ -289,7 +289,7 @@ m4_define([b4_symbol_value_template],
# these SYMBOL-NUMBERS. Use at class-level.
m4_define([b4_symbol_constructor_declare_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
-[ static inline
+[ static
symbol_type
make_[]b4_symbol_([$1], [id]) (dnl
b4_join(b4_symbol_if([$1], [has_type],
@@ -314,7 +314,8 @@ b4_symbol_foreach([b4_symbol_constructor_declare_])])
# Define symbol constructor for this SYMBOL-NUMBER.
m4_define([b4_symbol_constructor_define_],
[b4_symbol_if([$1], [is_token], [b4_symbol_if([$1], [has_id],
-[ b4_parser_class_name::symbol_type
+[ inline
+ b4_parser_class_name::symbol_type
b4_parser_class_name::make_[]b4_symbol_([$1], [id]) (dnl
b4_join(b4_symbol_if([$1], [has_type],
[const b4_symbol([$1], [type])& v]),