On Tue, Nov 13, 2018 at 10:40 AM Marek Polacek <pola...@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