This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to implement C++20 P1143R2, constinit (PR c++/91360)
- From: Marek Polacek <polacek at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 27 Aug 2019 15:58:59 -0400
- Subject: Re: C++ PATCH to implement C++20 P1143R2, constinit (PR c++/91360)
- References: <20190814212212.GM14737@redhat.com> <d145eb14-71de-0a4a-3f45-5f5136c323c7@oracle.com>
On Tue, Aug 27, 2019 at 09:54:50PM +0200, Paolo Carlini wrote:
> Hi,
>
> On 14/08/19 23:22, Marek Polacek wrote:
> > + /* [dcl.spec]/2 "At most one of the constexpr, consteval, and constinit
> > + keywords shall appear in a decl-specifier-seq." */
> > + if (constinit_p && constexpr_p)
> > + {
> > + error_at (min_location (declspecs->locations[ds_constinit],
> > + declspecs->locations[ds_constexpr]),
> > + "can use at most one of the %<constinit%> and %<constexpr%> "
> > + "specifiers");
>
> For this error we also have the option of using a gcc_rich_location, and
> add_range, etc, like for signed_p && unsigned_p, for example. Just saying,
> since we have the infrastructure ready...
Happy to polish the diagnostic after the core bits are in ;-).
--
Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA