public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>, richard.sandiford@arm.com
Subject: Re: [PATCH 3/3] change class-key of PODs to struct and others to class (PR 61339)
Date: Tue, 09 Jul 2019 18:53:00 -0000	[thread overview]
Message-ID: <27e77061-6d2a-1486-7e92-9dec902524b7@gmail.com> (raw)
In-Reply-To: <mpt1ryzqlu1.fsf@arm.com>

On 7/9/19 9:17 AM, Richard Sandiford wrote:
> Martin Sebor <msebor@gmail.com> writes:
>> diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
>> index cfc41e1ed86..625d5b17413 100644
>> --- a/gcc/cp/cp-tree.h
>> +++ b/gcc/cp/cp-tree.h
>> @@ -6428,7 +6428,7 @@ extern tree get_scope_of_declarator		(const cp_declarator *);
>>   extern void grok_special_member_properties	(tree);
>>   extern bool grok_ctor_properties		(const_tree, const_tree);
>>   extern bool grok_op_properties			(tree, bool);
>> -extern tree xref_tag				(enum tag_types, tree, tag_scope, bool, bool * = NULL);
>> +extern tree xref_tag				(enum tag_types, tree, tag_scope, bool);
>>   extern tree xref_tag_from_type			(tree, tree, tag_scope);
>>   extern void xref_basetypes			(tree, tree);
>>   extern tree start_enum				(tree, tree, tree, tree, bool, bool *);
>> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
>> index 005f99a6e15..9accc3d141b 100644
>> --- a/gcc/cp/decl.c
>> +++ b/gcc/cp/decl.c
>> @@ -14119,7 +14119,7 @@ lookup_and_check_tag (enum tag_types tag_code, tree name,
>>   
>>   static tree
>>   xref_tag_1 (enum tag_types tag_code, tree name,
>> -            tag_scope scope, bool template_header_p, bool *new_p)
>> +            tag_scope scope, bool template_header_p)
>>   {
>>     enum tree_code code;
>>     tree context = NULL_TREE;
>> @@ -14151,9 +14151,6 @@ xref_tag_1 (enum tag_types tag_code, tree name,
>>     if (t == error_mark_node)
>>       return error_mark_node;
>>   
>> -  /* Let the caller know this is a new type.  */
>> -  *new_p = t == NULL_TREE;
>> -
>>     if (scope != ts_current && t && current_class_type
>>         && template_class_depth (current_class_type)
>>         && template_header_p)
>> @@ -14215,7 +14212,6 @@ xref_tag_1 (enum tag_types tag_code, tree name,
>>   	      scope = ts_current;
>>   	    }
>>   	  t = pushtag (name, t, scope);
>> -	  *new_p = true;
>>   	}
>>       }
>>     else
>> @@ -14267,13 +14263,11 @@ xref_tag_1 (enum tag_types tag_code, tree name,
>>   
>>   tree
>>   xref_tag (enum tag_types tag_code, tree name,
>> -          tag_scope scope, bool template_header_p, bool *new_p /* = NULL */)
>> +          tag_scope scope, bool template_header_p)
>>   {
>>     bool dummy;
>> -  if (!new_p)
>> -    new_p = &dummy;
>>     bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
>> -  tree ret = xref_tag_1 (tag_code, name, scope, template_header_p, new_p);
>> +  tree ret = xref_tag_1 (tag_code, name, scope, template_header_p);
>>     timevar_cond_stop (TV_NAME_LOOKUP, subtime);
>>     return ret;
>>   }
>> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
>> index 52af8c0c6d6..d16bf253058 100644
>> --- a/gcc/cp/parser.c
>> +++ b/gcc/cp/parser.c
>> @@ -28193,8 +28193,6 @@ cp_parser_template_declaration_after_parameters (cp_parser* parser,
>>   					   member_p,
>>                                              /*explicit_specialization_p=*/false,
>>   					   &friend_p);
>> -      // maybe_warn_struct_vs_class (token->location, TREE_TYPE (decl));
>> -
>>         pop_deferring_access_checks ();
>>   
>>         /* If this is a member template declaration, let the front
> 
> Looks like this might have been part of 1/3.

Yes, this and a few other hunks didn't belong in this patch.
I removed them, retested the patch, and committed r273311.

> 
> OK otherwise.  Thanks again for doing this.
> 
> (I guess a lot of these tags could be removed, but that was just as true
> before the patch, so it's still a strict improvement.)

Most could be removed and my own preference would have been to
remove them.  The warning has a mechanism for figuring out which
ones can one can go and which ones are needed and I considered
making use of it.  In the end I decided to be conservative and
keep them in case someone preferred it that way.  Making
the change now that the cleanup is done will be slightly more
involved.  I suppose we could add yet another warning to find
them: -Wredundant-tag.

Martin

  reply	other threads:[~2019-07-09 18:34 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-08 21:58 [PATCH 0/3] add support for POD struct convention " Martin Sebor
2019-07-08 21:59 ` [PATCH 1/3] add -Wstruct-not-pod, -Wclass-is-pod, -Wmismatched-tags " Martin Sebor
2019-07-22 16:39   ` Martin Sebor
2019-08-01 18:09     ` Jason Merrill
2019-08-01 23:35       ` Martin Sebor
2019-08-05 19:25         ` Jason Merrill
2019-08-05 21:56           ` Martin Sebor
2019-08-05 22:43             ` Jason Merrill
2019-12-03 21:49               ` [PATCH] add " Martin Sebor
2019-12-04 23:37                 ` Jason Merrill
2019-12-05 23:33                   ` Martin Sebor
2019-12-05 23:47                     ` Jakub Jelinek
2019-12-06 19:08                       ` Jason Merrill
2019-12-10  0:29                         ` Martin Sebor
2019-12-16 16:35                           ` Martin Sebor
2019-12-16 23:01                           ` Jason Merrill
2019-12-16 23:36                             ` Martin Sebor
2019-12-17 19:41                               ` Jason Merrill
2020-02-18  8:42                 ` Stephan Bergmann
2020-02-18 15:57                   ` Martin Sebor
2019-07-22 22:37   ` [PATCH 1/3] add -Wstruct-not-pod, -Wclass-is-pod, " Jeff Law
2019-07-23  0:00     ` Mike Stump
2019-07-23  1:34     ` Martin Sebor
2019-07-24 17:43       ` Jeff Law
2019-07-24 19:30   ` Jeff Law
2019-07-08 22:02 ` [PATCH 2/3] change class-key of PODs to struct and others to class " Martin Sebor
2019-07-08 22:20   ` Martin Sebor
2019-07-09 14:11     ` Richard Sandiford
2019-07-09 16:37       ` Martin Sebor
2019-07-08 22:04 ` [PATCH 3/3] " Martin Sebor
2019-07-09 15:19   ` Richard Sandiford
2019-07-09 18:53     ` Martin Sebor [this message]
2019-07-10  9:40       ` Richard Biener
2019-07-10 10:52         ` Richard Sandiford
2019-07-12  8:41 ` [PATCH 0/3] add support for POD struct convention " Jakub Jelinek
2019-07-12 11:44   ` Jonathan Wakely
2019-07-12 15:14     ` Jason Merrill
2019-07-12 15:26     ` Martin Sebor
2019-07-12 15:36       ` Jonathan Wakely
2019-07-12 16:29         ` Martin Sebor
2019-07-12 15:40       ` Jason Merrill
2019-07-12 16:49         ` Martin Sebor
2019-08-14 18:50   ` Pedro Alves
2019-08-19 19:15     ` Jason Merrill
2019-07-23 16:20 ` Arvind Sankar
2019-07-23 16:42   ` Martin Sebor
2019-07-23 16:54     ` Arvind Sankar

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=27e77061-6d2a-1486-7e92-9dec902524b7@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.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).