[C++ Patch] Tiny grokdeclarator clean up

Paolo Carlini paolo.carlini@oracle.com
Fri Mar 1 00:32:00 GMT 2013


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.

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

	* decl.c (grokdeclarator): Remove dead code.
-------------- next part --------------
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)
     {


More information about the Gcc-patches mailing list