From: Paolo Carlini <paolo.carlini@oracle.com>
To: Jason Merrill <jason@redhat.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] PR 67318 ("[6 regression] Parsing error when using abbreviated integral type names in template parameter pack declaration")
Date: Wed, 09 Sep 2015 21:14:00 -0000 [thread overview]
Message-ID: <55F0A094.4040609@oracle.com> (raw)
In-Reply-To: <55F08345.2010408@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
... what about something this simple? Passes testing...
Thanks,
Paolo.
///////////////////////////
[-- Attachment #2: patch_67318_2 --]
[-- Type: text/plain, Size: 1283 bytes --]
Index: cp/parser.c
===================================================================
--- cp/parser.c (revision 227600)
+++ cp/parser.c (working copy)
@@ -19626,11 +19626,12 @@ cp_parser_parameter_declaration (cp_parser *parser
if (type && DECL_P (type))
type = TREE_TYPE (type);
- if (type
- && TREE_CODE (type) != TYPE_PACK_EXPANSION
- && declarator_can_be_parameter_pack (declarator)
- && (template_parm_p || uses_parameter_packs (type)))
- {
+ if (((type
+ && TREE_CODE (type) != TYPE_PACK_EXPANSION
+ && (template_parm_p || uses_parameter_packs (type)))
+ || (!type && template_parm_p))
+ && declarator_can_be_parameter_pack (declarator))
+ {
/* Consume the `...'. */
cp_lexer_consume_token (parser->lexer);
maybe_warn_variadic_templates ();
Index: testsuite/g++.dg/cpp0x/variadic166.C
===================================================================
--- testsuite/g++.dg/cpp0x/variadic166.C (revision 0)
+++ testsuite/g++.dg/cpp0x/variadic166.C (working copy)
@@ -0,0 +1,14 @@
+// PR c++/67318
+// { dg-do compile { target c++11 } }
+
+template<signed...>
+struct MyStruct1;
+
+template<unsigned...>
+struct MyStruct2;
+
+template<short...>
+struct MyStruct3;
+
+template<long...>
+struct MyStruct4;
next prev parent reply other threads:[~2015-09-09 21:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 16:58 Paolo Carlini
2015-09-09 18:51 ` Jason Merrill
2015-09-09 19:35 ` Paolo Carlini
2015-09-09 21:14 ` Paolo Carlini [this message]
2015-09-10 13:36 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F0A094.4040609@oracle.com \
--to=paolo.carlini@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).