public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Umesh Kalappa <umesh.kalappa0@gmail.com>
Cc: jason@redhat.com, gcc-patches@gcc.gnu.org,
	kamlesh kumar <kamleshbhalui@gmail.com>
Subject: Re: Bug 52869 - [DR 1207] "this" not being allowed in noexcept clauses
Date: Thu, 15 Nov 2018 15:56:00 -0000	[thread overview]
Message-ID: <20181115155615.GO28582@redhat.com> (raw)
In-Reply-To: <CAGfacvR36JNTS4ANaOs=+vgW4o4jd8zvE=f+LYtgNONzVM4=eg@mail.gmail.com>

On Thu, Nov 15, 2018 at 02:26:24PM +0530, Umesh Kalappa wrote:
> Thank you Marek  for the inputs .
> >>In the future, if using diff, please also use the -p option.
> We are using svn diif  and other comments are addressed .

Thanks, but it doesn't seem like the -p option was used.

> please let us know  your take on the  revised attached patch .


Index: cp/ChangeLog
===================================================================
--- cp/ChangeLog	(revision 266026)
+++ cp/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2018-11-14  Kamlesh Kumar  <kamleshbhalui@gmail.com>
+
+	PR c++/52869
+	*parser.c () :  restore the old current_class_{ptr,ref} by
+	inject_this_parameter().
+

This is still the same; can you adjust it according to my last suggestion?

Index: cp/parser.c
===================================================================
--- cp/parser.c	(revision 266026)
+++ cp/parser.c	(working copy)
@@ -24620,6 +24620,12 @@
 	{
 	  matching_parens parens;
 	  parens.consume_open (parser);
+	  
+	  tree save_ccp = current_class_ptr;
+	  tree save_ccr = current_class_ref;
+	  

Watch out for trailing whitespace in the blank lines.

+	  if (current_class_type)
+              inject_this_parameter (current_class_type, TYPE_UNQUALIFIED);
 
I think you can remove the if here.

 	  if (require_constexpr)
 	    {
@@ -24640,6 +24646,9 @@
 	    }
 
 	  parens.require_close (parser);
+
+	  save_ccp = current_class_ptr = save_ccp;
+	  save_ccr = current_class_ref = save_ccr;

You don't need to set save_cc[pr] to itself here.

Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 266026)
+++ testsuite/ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2018-11-14  Kamlesh Kumar  <kamleshbhalui@gmail.com>
+
+	PR c++/52869
+	* g++.dg//DRs/dr52869.C: New.
+

So DR != PR.  Please name the test dr1207.C

Index: testsuite/g++.dg/DRs/dr52869.C
===================================================================
--- testsuite/g++.dg/DRs/dr52869.C	(nonexistent)
+++ testsuite/g++.dg/DRs/dr52869.C	(working copy)
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O0 -std=c++11" } */

Instead of this, do:

// { dg-do compile { target c++11 } }

Also, I wrote a test that fails if current_class_{ptr,ref} aren't properly
restored:

// DR 1207
// PR c++/52869
// { dg-do compile { target c++11 } }

void
fn ()
{
  struct S {
    bool operator!() noexcept(false);
  } s;
  S t = s;
}

So you can add that one too, e.g. testsuite/g++.dg/DRs/dr1207-2.C.

Thanks,
Marek

  reply	other threads:[~2018-11-15 15:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-13  6:20 Umesh Kalappa
2018-11-13 15:40 ` Marek Polacek
2018-11-13 21:25   ` Jason Merrill
2018-11-14 11:49     ` Umesh Kalappa
2018-11-14 13:23       ` Umesh Kalappa
2018-11-14 14:33       ` Marek Polacek
2018-11-14 16:25         ` Umesh Kalappa
2018-11-14 18:53           ` Marek Polacek
2018-11-15  8:56             ` Umesh Kalappa
2018-11-15 15:56               ` Marek Polacek [this message]
2018-11-15 15:59                 ` Marek Polacek
2018-11-16  6:53                 ` Umesh Kalappa
2018-11-16 18:18                   ` Marek Polacek
2018-11-16 21:55                     ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181115155615.GO28582@redhat.com \
    --to=polacek@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=kamleshbhalui@gmail.com \
    --cc=umesh.kalappa0@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).