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

2019-08-28 Thread Marek Polacek
On Wed, Aug 28, 2019 at 04:15:54PM -0400, Jason Merrill wrote: > OK, thanks. Thanks! I've now updated wwwdocs: Index: gcc-10/changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-10/changes.html,v retrieving revision 1.11 diff -u -

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

2019-08-28 Thread Jason Merrill
On 8/27/19 11:24 AM, Marek Polacek wrote: On Fri, Aug 23, 2019 at 03:10:37PM -0700, Jason Merrill wrote: +/* True if DECL is declared 'constinit'. */ +#define DECL_DECLARED_CONSTINIT_P(DECL) \ + DECL_LANG_FLAG_0 (VAR_DECL_CHECK (STRIP_TEMPLATE (DECL))) Hmm, given that 'constinit' only affect

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

2019-08-27 Thread Marek Polacek
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) > > +

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

2019-08-27 Thread Paolo Carlini
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], +

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

2019-08-27 Thread Marek Polacek
On Fri, Aug 23, 2019 at 03:10:37PM -0700, Jason Merrill wrote: > > +/* True if DECL is declared 'constinit'. */ > > +#define DECL_DECLARED_CONSTINIT_P(DECL) \ > > + DECL_LANG_FLAG_0 (VAR_DECL_CHECK (STRIP_TEMPLATE (DECL))) > > Hmm, given that 'constinit' only affects the declaration, do we reall

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

2019-08-23 Thread Jason Merrill
On 8/14/19 2:22 PM, Marek Polacek wrote: This patch implements the C++20 specifier constinit, as described in . It makes sure that the compiler requires constant initialization of a variable (it can only be applied to variables with static or thread storage duration).

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

2019-08-14 Thread Marek Polacek
This patch implements the C++20 specifier constinit, as described in . It makes sure that the compiler requires constant initialization of a variable (it can only be applied to variables with static or thread storage duration). Note the variable is *not* const; it is pos