* [PATCH] * parser.c (cp_parser_sizeof_operand): Remove redundant grokdeclarator.
@ 2018-10-25 22:01 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2018-10-25 22:01 UTC (permalink / raw)
To: gcc-patches; +Cc: Martin Sebor
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(-)
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
base-commit: fa2f0c7dbe1d24ce86db3a939c5f922b1ec496bb
--
2.17.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-25 19:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-25 22:01 [PATCH] * parser.c (cp_parser_sizeof_operand): Remove redundant grokdeclarator Jason Merrill
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).