diff mbox

[C++] Tiny grokdeclarator clean up

Message ID 512FF6F7.5090800@oracle.com
State New
Headers show

Commit Message

Paolo Carlini March 1, 2013, 12:31 a.m. UTC
Hi,

for 4.9 I'd like to clean-up a bit grokdeclarator: today I noticed this 
low hanging fruit which seems straightforward enough for 4.8.0 too 
(unless it hints to a bug?!?)

Thanks,
Paolo.

//////////////////////////
2013-03-01  Paolo Carlini  <paolo.carlini@oracle.com>

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

Comments

Jason Merrill March 1, 2013, 3:35 a.m. UTC | #1
On 02/28/2013 07:31 PM, Paolo Carlini wrote:
> for 4.9 I'd like to clean-up a bit grokdeclarator: today I noticed this
> low hanging fruit which seems straightforward enough for 4.8.0 too
> (unless it hints to a bug?!?)

OK, looks like the code that set that variable was removed in 2004, by 
the cdk_* rewrite.  Guess we would have noticed any issues by now.  :)

Jason
diff mbox

Patch

Index: decl.c
===================================================================
--- decl.c	(revision 196362)
+++ decl.c	(working copy)
@@ -8599,7 +8599,6 @@  grokdeclarator (const cp_declarator *declarator,
   int explicit_int = 0;
   int explicit_char = 0;
   int defaulted_int = 0;
-  tree dependent_name = NULL_TREE;
 
   tree typedef_decl = NULL_TREE;
   const char *name = NULL;
@@ -9196,12 +9195,6 @@  grokdeclarator (const cp_declarator *declarator,
     }
   friendp = decl_spec_seq_has_spec_p (declspecs, ds_friend);
 
-  if (dependent_name && !friendp)
-    {
-      error ("%<%T::%D%> is not a valid declarator", ctype, dependent_name);
-      return error_mark_node;
-    }
-
   /* Issue errors about use of storage classes for parameters.  */
   if (decl_context == PARM)
     {