[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: syntax_error constructor is declared inline
From: |
Akim Demaille |
Subject: |
Re: syntax_error constructor is declared inline |
Date: |
Tue, 8 May 2018 11:13:43 +0200 |
hi Frank,
> Le 14 mars 2018 à 04:03, Frank Heckenbach <address@hidden> a écrit :
>
> I checked it and found that it's only put in the header if
>
> %define api.token.constructor
>
> is set. But that can only be set if
>
> %define api.value.type
>
> is also set. So this indeed seems to be wrong for non-variant users.
>
> Instead of removing "inline" as suggested in the other bug report
> (which would then break with api.token.constructor), the following
> patch will always put the definition in the header.
It seems correct to me.
Unfortunately I’m all rusted on Bison. I don’t know if there’s
a good CI somewhere for it (the one I was using was retired…).
> I will apply this patch in my C++17 version, but since I'm not a
> Bison maintainer, I can't promise it will go in the C++98 parser, or
> in the official Bison sources at all. For now, you can apply the
> patch manually (your installation directory may vary).
I will try to make soon a maintenance release of Bison, with
bug fixing and gnulib updates. Then it will be great to address
modern C++. However, I’d prefer sticking to a single skeleton
rather than having to maintain several (not to mention the CI
headaches…)
> Regards,
> Frank
>
> --- /usr/share/bison/c++.m4
> +++ /usr/share/bison/c++.m4
> @@ -161,7 +161,10 @@
> /// 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;])[
> };
>
> @@ -279,13 +282,7 @@
> # ----------------------
> # Provide the implementation needed by the public types.
> m4_define([b4_public_types_define],
> -[[ inline
> - ]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 <typename Base>
> inline
> ]b4_parser_class_name[::basic_symbol<Base>::basic_symbol ()
>
I see that you also have submitted this on Savannah as
https://savannah.gnu.org/patch/?9616. But are you aware
of any means to merge you submission in a way similar to
Gitlab, or Git***? What service does Savanah bring on
this regard?
Cheers.