From 7ff7ef678c4d3561ac08af13ff626985820b2fee Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 30 Dec 2018 09:47:31 +0100 Subject: [PATCH] c++: inline the implementation of syntax_error in its definition This way, it is easier to make sure its implementation is available in glr.cc too, which is not the case currently. * data/skeletons/c++.m4 (b4_public_types_define): Move the implementation of syntax_error... (b4_public_types_declare): here. --- data/skeletons/c++.m4 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/data/skeletons/c++.m4 b/data/skeletons/c++.m4 index bd2acfd8..0ef5bb70 100644 --- a/data/skeletons/c++.m4 +++ b/data/skeletons/c++.m4 @@ -214,7 +214,11 @@ m4_define([b4_public_types_declare], /// Syntax errors thrown from user actions. struct syntax_error : std::runtime_error { - syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m);]b4_locations_if([ + syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m) + : std::runtime_error (m)]b4_locations_if([ + , location (l)])[ + {}]b4_locations_if([ + location_type location;])[ }; @@ -360,12 +364,7 @@ m4_define([b4_symbol_type_define], # ----------------------------- # Provide the implementation needed by the public types. m4_define([b4_public_types_define], -[ b4_inline([$1])b4_parser_class_name[::syntax_error::syntax_error (]b4_locations_if([const location_type& l, ])[const std::string& m) - : std::runtime_error (m)]b4_locations_if([ - , location (l)])[ - {} - - // basic_symbol. +[[ // basic_symbol. template ]b4_parser_class_name[::basic_symbol::basic_symbol () : value ()]b4_locations_if([