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: Bug 52869 - [DR 1207] "this" not being allowed in noexcept clauses


Thank you Jason and Marek for the suggestions .

Attached patch(pr86512.patch)  along the Changelog .

and also please note tested the patch for x86_64 only with "make -k
check-gcc RUNTESTFLAGS=dg.exp=g++.dg" and see no regressions.

We are runing the make check-gcc(x86_64) and will let know for any regressions .

Meanwhile ,Please let us know your thoughts on the patch.

Thank you
~Umesh

On Wed, Nov 14, 2018 at 2:55 AM Jason Merrill <jason@redhat.com> wrote:
>
> On Tue, Nov 13, 2018 at 10:40 AM Marek Polacek <polacek@redhat.com> wrote:
> > On Tue, Nov 13, 2018 at 11:49:55AM +0530, Umesh Kalappa wrote:
> > > Hi All,
> > >
> > > the following patch fix the subjected issue
> > >
> > > Index: gcc/cp/parser.c
> > > ===================================================================
> > > --- gcc/cp/parser.c     (revision 266026)
> > > +++ gcc/cp/parser.c     (working copy)
> > > @@ -24615,6 +24615,8 @@
> > >      {
> > >        tree expr;
> > >        cp_lexer_consume_token (parser->lexer);
> > > +
> > > +      inject_this_parameter (current_class_type, TYPE_UNQUALIFIED);
> > >
> > >        if (cp_lexer_peek_token (parser->lexer)->type == CPP_OPEN_PAREN)
> > >         {
> > >
> > >
> > > ok to commit along the testcase with changelog update ?
> >
> > Thanks for the patch.
> >
> > Please also include the testcase along with the patch (and I think it should
> > also test noexcept in a template).  Please also include a ChangeLog entry
> > in the patch submission.
> >
> > Can you describe how this patch has been tested?
> >
> > Further, wouldn't it be better to call inject_this_parameter inside the
> > CPP_OPEN_PAREN block?  If noexcept doesn't have any expression, then it
> > can't refer to "this".
>
> Agreed, thanks.  You also need to restore the old
> current_class_{ptr,ref} at the end of the noexcept-specifier.
>
> Jason

Attachment: pr86512.patch
Description: Binary data


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