public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51239] New: ICE with variadic template alias
@ 2011-11-20 17:09 illissius at gmail dot com
  2011-11-21 22:23 ` [Bug c++/51239] " dodji at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: illissius at gmail dot com @ 2011-11-20 17:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

             Bug #: 51239
           Summary: ICE with variadic template alias
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: illissius@gmail.com


The following code (self-contained):

template<typename T, typename...>
using head = T;

template<typename... Ts>
using x = head<Ts...>;

results for me in the following error:

$ LD_LIBRARY_PATH=/opt/gcc4.7/lib:$LD_LIBRARY_PATH PATH=/opt/gcc4.7/bin/:$PATH
g++ -std=c++11 test68.cpp 
test68.cpp:2:15: internal compiler error: tree check: accessed elt 2 of
tree_vec with 1 elts in tsubst_pack_expansion, at cp/pt.c:9298
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

GCC version:

$ LD_LIBRARY_PATH=/opt/gcc4.7/lib:$LD_LIBRARY_PATH PATH=/opt/gcc4.7/bin/:$PATH
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/gcc4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../trunk/configure --disable-bootstrap
--enable-languages=c,c++ --prefix=/opt/gcc4.7
Thread model: posix
gcc version 4.7.0 20111120 (experimental) (GCC)

SVN revision: 181530

A version from 20111109 produced the same error (at a different line number).

The line in question in the current revision, and the two lines before it:
          levels = TMPL_ARGS_DEPTH (args);
          if (level <= levels)
            arg_pack = TMPL_ARG (args, level, idx);


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

* [Bug c++/51239] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
@ 2011-11-21 22:23 ` dodji at gcc dot gnu.org
  2011-12-01 14:44 ` dodji at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-11-21 22:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-11-21
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1


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

* [Bug c++/51239] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
  2011-11-21 22:23 ` [Bug c++/51239] " dodji at gcc dot gnu.org
@ 2011-12-01 14:44 ` dodji at gcc dot gnu.org
  2011-12-03 17:24 ` dodji at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-12-01 14:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

--- Comment #1 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-12-01 14:44:10 UTC ---
Here is my understanding of what is happening here.

When we first build the type head<Ts...>, we don't yet know the actual
number of arguments for the 'head' template.  So we should build a
representation of head<Ts...> in which we don't yet try to substitute
Ts... for the parameters of 'head'.

That substitution would happen when 'x' is instantiated with a real
argument pack.  That argument pack would be substituted for Ts... and
yield a real list of arguments that would in turn be applied to 'head'.

Instead, we proceed as if we knew the number of arguments,
and try to apply Ts... to head directly.  And from there on, bad
things happen.

I am currently testing a patch for this.


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

* [Bug c++/51239] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
  2011-11-21 22:23 ` [Bug c++/51239] " dodji at gcc dot gnu.org
  2011-12-01 14:44 ` dodji at gcc dot gnu.org
@ 2011-12-03 17:24 ` dodji at gcc dot gnu.org
  2012-03-11 22:33 ` dodji at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-12-03 17:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

--- Comment #2 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-12-03 17:23:43 UTC ---
A candidate patch for this has been submitted to
http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00163.html


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

* [Bug c++/51239] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (2 preceding siblings ...)
  2011-12-03 17:24 ` dodji at gcc dot gnu.org
@ 2012-03-11 22:33 ` dodji at gcc dot gnu.org
  2013-04-05 16:29 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dodji at gcc dot gnu.org @ 2012-03-11 22:33 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

Dodji Seketeli <dodji at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |SUSPENDED

--- Comment #3 from Dodji Seketeli <dodji at gcc dot gnu.org> 2012-03-11 22:32:48 UTC ---
There were more patches for this at
http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00728.html and
http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00729.html.

I'd need to address the comments raised by the first patch, at least.  But at
the same time, it turned out that we are hitting DR 1430
(http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#1430).

So I am suspending this bug for now because depending on the resolution of DR
1430 there, we might have to take a totally different direction.


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

* [Bug c++/51239] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (3 preceding siblings ...)
  2012-03-11 22:33 ` dodji at gcc dot gnu.org
@ 2013-04-05 16:29 ` jason at gcc dot gnu.org
  2013-04-11 15:19 ` [Bug c++/51239] [DR 1430] " jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-05 16:29 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mustrumr97 at gmail dot com

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-05 16:29:42 UTC ---
*** Bug 53786 has been marked as a duplicate of this bug. ***


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

* [Bug c++/51239] [DR 1430] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (4 preceding siblings ...)
  2013-04-05 16:29 ` jason at gcc dot gnu.org
@ 2013-04-11 15:19 ` jason at gcc dot gnu.org
  2013-08-03 20:35 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-04-11 15:19 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2013-04-11 15:19:29 UTC ---
Created attachment 29859
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29859
initial patch

This patch takes the approach the committee seems to be settling on for 1430:
just disallowing a pack expansion passed to a fixed alias template parameter. 
But I don't think it's complete, because I think the rules need to be more
complex; for one thing, it ought to allow it for aliases that are equivalent to
the template they refer to.


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

* [Bug c++/51239] [DR 1430] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (5 preceding siblings ...)
  2013-04-11 15:19 ` [Bug c++/51239] [DR 1430] " jason at gcc dot gnu.org
@ 2013-08-03 20:35 ` jason at gcc dot gnu.org
  2014-02-24 22:28 ` jason at gcc dot gnu.org
  2014-08-01 18:46 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-08-03 20:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Patch applied as r201469.  Leaving suspended until the DR resolution is final.


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

* [Bug c++/51239] [DR 1430] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (6 preceding siblings ...)
  2013-08-03 20:35 ` jason at gcc dot gnu.org
@ 2014-02-24 22:28 ` jason at gcc dot gnu.org
  2014-08-01 18:46 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-24 22:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reagentoo at gmail dot com

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
*** Bug 60328 has been marked as a duplicate of this bug. ***


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

* [Bug c++/51239] [DR 1430] ICE with variadic template alias
  2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
                   ` (7 preceding siblings ...)
  2014-02-24 22:28 ` jason at gcc dot gnu.org
@ 2014-08-01 18:46 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-01 18:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51239

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmetcalfe at acm dot org

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
*** Bug 57138 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2014-08-01 18:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-20 17:09 [Bug c++/51239] New: ICE with variadic template alias illissius at gmail dot com
2011-11-21 22:23 ` [Bug c++/51239] " dodji at gcc dot gnu.org
2011-12-01 14:44 ` dodji at gcc dot gnu.org
2011-12-03 17:24 ` dodji at gcc dot gnu.org
2012-03-11 22:33 ` dodji at gcc dot gnu.org
2013-04-05 16:29 ` jason at gcc dot gnu.org
2013-04-11 15:19 ` [Bug c++/51239] [DR 1430] " jason at gcc dot gnu.org
2013-08-03 20:35 ` jason at gcc dot gnu.org
2014-02-24 22:28 ` jason at gcc dot gnu.org
2014-08-01 18:46 ` jason at gcc dot gnu.org

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).