public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][C++] PR 65071
@ 2015-02-18  8:19 Andrea Azzarone
  2015-02-18  8:20 ` Andrea Azzarone
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Azzarone @ 2015-02-18  8:19 UTC (permalink / raw)
  To: gcc-patches

Hi all,

this patch try to fix PR c++/65071 (ICE on valid, sizeof...() of
template template parameter pack in return type).

2015-2-18 Andrea Azzarone <azzaronea@gmail.com>
  PR c++/65071
  * gcc/cp/parser.c (cp_parser_sizeof_pack) Also consider template
template parameters.

Thanks.

-- 
Andrea Azzarone

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][C++] PR 65071
  2015-02-18  8:19 [PATCH][C++] PR 65071 Andrea Azzarone
@ 2015-02-18  8:20 ` Andrea Azzarone
  2015-07-11 19:40   ` Paolo Carlini
  0 siblings, 1 reply; 5+ messages in thread
From: Andrea Azzarone @ 2015-02-18  8:20 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 509 bytes --]

Ops, forgot the diff.

2015-02-18 9:19 GMT+01:00 Andrea Azzarone <azzaronea@gmail.com>:
> Hi all,
>
> this patch try to fix PR c++/65071 (ICE on valid, sizeof...() of
> template template parameter pack in return type).
>
> 2015-2-18 Andrea Azzarone <azzaronea@gmail.com>
>   PR c++/65071
>   * gcc/cp/parser.c (cp_parser_sizeof_pack) Also consider template
> template parameters.
>
> Thanks.
>
> --
> Andrea Azzarone



-- 
Andrea Azzarone
http://launchpad.net/~andyrock
http://wiki.ubuntu.com/AndreaAzzarone

[-- Attachment #2: pr-65071.patch --]
[-- Type: text/x-patch, Size: 998 bytes --]

Index: gcc/cp/parser.c
===================================================================
--- gcc/cp/parser.c	(revision 220698)
+++ gcc/cp/parser.c	(working copy)
@@ -24369,7 +24369,7 @@ cp_parser_sizeof_pack (cp_parser *parser
   if (expr == error_mark_node)
     cp_parser_name_lookup_error (parser, name, expr, NLE_NULL,
 				 token->location);
-  if (TREE_CODE (expr) == TYPE_DECL)
+  if (TREE_CODE (expr) == TYPE_DECL || TREE_CODE (expr) == TEMPLATE_DECL)
     expr = TREE_TYPE (expr);
   else if (TREE_CODE (expr) == CONST_DECL)
     expr = DECL_INITIAL (expr);
Index: gcc/testsuite/g++.dg/cpp0x/vt-65071.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/vt-65071.C	(revision 0)
+++ gcc/testsuite/g++.dg/cpp0x/vt-65071.C	(working copy)
@@ -0,0 +1,9 @@
+// PR c++/65071
+// { dg-do compile { target c++11 } }
+
+template<int> struct S {};
+
+template<template<int> class... T, int N>
+S<sizeof...(T)> foo(T<N>...);
+
+auto x = foo(S<2>{});


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][C++] PR 65071
  2015-02-18  8:20 ` Andrea Azzarone
@ 2015-07-11 19:40   ` Paolo Carlini
  2015-07-14 19:10     ` Jason Merrill
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Carlini @ 2015-07-11 19:40 UTC (permalink / raw)
  To: Andrea Azzarone, gcc-patches; +Cc: Jason Merrill

Hi,

I'm going to ping this on behalf of Andrea: the patch seems almost 
obvious to me and so small to not immediately require a copyright 
assignment (not sure whether Andrea already has it on file?!?). I also 
double checked that it still applies cleanly and passes testing.

Thanks,
Paolo.

On 02/18/2015 09:20 AM, Andrea Azzarone wrote:
> Ops, forgot the diff.
>
> 2015-02-18 9:19 GMT+01:00 Andrea Azzarone <azzaronea@gmail.com>:
>> Hi all,
>>
>> this patch try to fix PR c++/65071 (ICE on valid, sizeof...() of
>> template template parameter pack in return type).
>>
>> 2015-2-18 Andrea Azzarone <azzaronea@gmail.com>
>>    PR c++/65071
>>    * gcc/cp/parser.c (cp_parser_sizeof_pack) Also consider template
>> template parameters.
>>
>> Thanks.
>>
>> --
>> Andrea Azzarone
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][C++] PR 65071
  2015-07-11 19:40   ` Paolo Carlini
@ 2015-07-14 19:10     ` Jason Merrill
  2015-07-14 19:10       ` Jason Merrill
  0 siblings, 1 reply; 5+ messages in thread
From: Jason Merrill @ 2015-07-14 19:10 UTC (permalink / raw)
  To: Paolo Carlini, Andrea Azzarone, gcc-patches

On 07/11/2015 03:40 PM, Paolo Carlini wrote:
> I'm going to ping this on behalf of Andrea: the patch seems almost
> obvious to me and so small to not immediately require a copyright
> assignment (not sure whether Andrea already has it on file?!?). I also
> double checked that it still applies cleanly and passes testing.

OK, thanks.

Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][C++] PR 65071
  2015-07-14 19:10     ` Jason Merrill
@ 2015-07-14 19:10       ` Jason Merrill
  0 siblings, 0 replies; 5+ messages in thread
From: Jason Merrill @ 2015-07-14 19:10 UTC (permalink / raw)
  To: gcc-patches

On 07/11/2015 03:40 PM, Paolo Carlini wrote:
> I'm going to ping this on behalf of Andrea: the patch seems almost
> obvious to me and so small to not immediately require a copyright
> assignment (not sure whether Andrea already has it on file?!?). I also
> double checked that it still applies cleanly and passes testing.

OK, thanks.

Jason


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-14 18:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18  8:19 [PATCH][C++] PR 65071 Andrea Azzarone
2015-02-18  8:20 ` Andrea Azzarone
2015-07-11 19:40   ` Paolo Carlini
2015-07-14 19:10     ` Jason Merrill
2015-07-14 19:10       ` 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).