This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH to implement C++20 P1143R2, constinit (PR c++/91360)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]