diff mbox

[C++] Remove pointless code in grokdeclarator

Message ID 55881334.1090900@oracle.com
State New
Headers show

Commit Message

Paolo Carlini June 22, 2015, 1:52 p.m. UTC
Hi,

I think this qualifies as obvious: we reset type_quals to 
TYPE_UNQUALIFIED and then we only use it in a 'if (type_quals != 
TYPE_UNQUALIFIED)' test before returning.

Thanks,
Paolo.

///////////////////////
2015-06-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokdeclarator): Remove pointless code.

Comments

Jason Merrill June 22, 2015, 4:56 p.m. UTC | #1
I think we should keep a comment to clarify why we don't care about 
type_quals here.

Jason
Paolo Carlini June 22, 2015, 5:27 p.m. UTC | #2
Hi,

On 06/22/2015 06:56 PM, Jason Merrill wrote:
> I think we should keep a comment to clarify why we don't care about 
> type_quals here.
Ok, I will commit with a comment added.

Thanks,
Paolo.
diff mbox

Patch

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 224724)
+++ cp/decl.c	(working copy)
@@ -10476,19 +10477,9 @@  grokdeclarator (const cp_declarator *declarator,
 
   if (decl_context == TYPENAME)
     {
-      /* Note that the grammar rejects storage classes
-	 in typenames, fields or parameters.  */
-      if (type_quals != TYPE_UNQUALIFIED)
-	type_quals = TYPE_UNQUALIFIED;
-
       /* Special case: "friend class foo" looks like a TYPENAME context.  */
       if (friendp)
 	{
-	  if (type_quals != TYPE_UNQUALIFIED)
-	    {
-	      error ("type qualifiers specified for friend class declaration");
-	      type_quals = TYPE_UNQUALIFIED;
-	    }
 	  if (inlinep)
 	    {
 	      error ("%<inline%> specified for friend class declaration");