diff mbox series

* parser.c (cp_parser_sizeof_operand): Remove redundant grokdeclarator.

Message ID 20181025192255.27920-1-jason@redhat.com
State New
Headers show
Series * parser.c (cp_parser_sizeof_operand): Remove redundant grokdeclarator. | expand

Commit Message

Jason Merrill Oct. 25, 2018, 7:22 p.m. UTC
The call in cp_parser_sizeof_operand is also redundant.

Tested x86_64-pc-linux-gnu, applying to trunk.

---
 gcc/cp/parser.c  | 15 +--------------
 gcc/cp/ChangeLog |  5 +++++
 2 files changed, 6 insertions(+), 14 deletions(-)


base-commit: fa2f0c7dbe1d24ce86db3a939c5f922b1ec496bb
diff mbox series

Patch

diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 2533871fb28..ebe326eb923 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -28167,20 +28167,7 @@  cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
 
       /* If all went well, then we're done.  */
       if (cp_parser_parse_definitely (parser))
-	{
-	  cp_decl_specifier_seq decl_specs;
-
-	  /* Build a trivial decl-specifier-seq.  */
-	  clear_decl_specs (&decl_specs);
-	  decl_specs.type = type;
-
-	  /* Call grokdeclarator to figure out what type this is.  */
-	  expr = grokdeclarator (NULL,
-				 &decl_specs,
-				 TYPENAME,
-				 /*initialized=*/0,
-				 /*attrlist=*/NULL);
-	}
+	expr = type;
     }
 
   /* If the type-id production did not work out, then we must be
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c90d91b7b82..7ee0bb99b18 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@ 
+2018-10-23  Jason Merrill  <jason@redhat.com>
+
+	* parser.c (cp_parser_sizeof_operand): Remove redundant use of
+	grokdeclarator.
+
 2018-10-24  Jakub Jelinek  <jakub@redhat.com>
 
 	PR c++/86288