public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/37737]  New: ICE on variadic template function
@ 2008-10-05 10:55 cfairles at gcc dot gnu dot org
  2008-10-05 12:03 ` [Bug c++/37737] " cfairles at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: cfairles at gcc dot gnu dot org @ 2008-10-05 10:55 UTC (permalink / raw)
  To: gcc-bugs

The following snippet ICE's:

void f() { }

template<class U, class... T>
void f(){ f<T...>(); }

int main()
{ 
  f<char>();
}


tree check: 
accessed elt 1 of tree_vec with 0 elts in get_innermost_template_args
at cp/pt.c:516

Is this ice-on-valid or will f<>() not be picked up by the non-template
function?


-- 
           Summary: ICE on variadic template function
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cfairles at gcc dot gnu dot org
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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


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

* [Bug c++/37737] ICE on variadic template function
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
@ 2008-10-05 12:03 ` cfairles at gcc dot gnu dot org
  2008-10-05 12:10 ` cfairles at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cfairles at gcc dot gnu dot org @ 2008-10-05 12:03 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]



------- Comment #1 from cfairles at gcc dot gnu dot org  2008-10-05 12:02 -------
This variant also ice's in same place but issues error first:

ice2.cpp:
template<class U, class... T>
void f()
{
  f<T...>();
}

template<>
void f() { }

int main()
{
  f<char>();
}

ice2.cpp:8: error: template-id ‘f<>’ for ‘void f()’ does not match any template
declaration
ice2.cpp: In function ‘void f() [with U = char, T = ]’:
ice2.cpp:12:   instantiated from here
ice2.cpp:4: internal compiler error: tree check: accessed elt 1 of tree_vec
with 0 elts in get_innermost_template_args, at cp/pt.c:516

(note: both compiled with -std=c++0x)


-- 


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


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

* [Bug c++/37737] ICE on variadic template function
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
  2008-10-05 12:03 ` [Bug c++/37737] " cfairles at gcc dot gnu dot org
@ 2008-10-05 12:10 ` cfairles at gcc dot gnu dot org
  2008-10-08 14:07 ` [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction cfairles at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cfairles at gcc dot gnu dot org @ 2008-10-05 12:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from cfairles at gcc dot gnu dot org  2008-10-05 12:09 -------
I believe these are both ice-on-invalid code.


-- 

cfairles at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
  2008-10-05 12:03 ` [Bug c++/37737] " cfairles at gcc dot gnu dot org
  2008-10-05 12:10 ` cfairles at gcc dot gnu dot org
@ 2008-10-08 14:07 ` cfairles at gcc dot gnu dot org
  2008-10-24 11:47 ` cfairles at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cfairles at gcc dot gnu dot org @ 2008-10-08 14:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from cfairles at gcc dot gnu dot org  2008-10-08 14:06 -------
changed summary to something more specific


-- 

cfairles at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE on variadic template    |[c++0x] ICE in
                   |function                    |get_innermost_template_args
                   |                            |at cp/pt.c:516 during
                   |                            |variadic function overload
                   |                            |deduction


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-10-08 14:07 ` [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction cfairles at gcc dot gnu dot org
@ 2008-10-24 11:47 ` cfairles at gcc dot gnu dot org
  2008-12-24 20:22 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cfairles at gcc dot gnu dot org @ 2008-10-24 11:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from cfairles at gcc dot gnu dot org  2008-10-24 11:46 -------
Adding error-recovery since 2nd testcase does print out sane error msg before
ICE.


-- 

cfairles at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-10-24 11:47 ` cfairles at gcc dot gnu dot org
@ 2008-12-24 20:22 ` pinskia at gcc dot gnu dot org
  2008-12-28 22:55 ` reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-24 20:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2008-12-24 20:20 -------
Confirmed,
t.cc: In function 'void f() [with U = char, T = ]':
t.cc:9:   instantiated from here
t.cc:5: internal compiler error: tree check: accessed elt 1 of tree_vec with 0
elts in get_innermost_template_args, at cp/pt.c:516
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Only happens with checking turned on too.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-redhat-linux         |
   GCC host triplet|x86_64-redhat-linux         |
 GCC target triplet|x86_64-redhat-linux         |
           Keywords|                            |ice-checking
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-24 20:20:48
               date|                            |


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-12-24 20:22 ` pinskia at gcc dot gnu dot org
@ 2008-12-28 22:55 ` reichelt at gcc dot gnu dot org
  2009-01-27 18:33 ` ethouris at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-12-28 22:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from reichelt at gcc dot gnu dot org  2008-12-28 22:53 -------
Removing error-recovery because the first testcase crashes without previous
error message.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|error-recovery              |monitored


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-12-28 22:55 ` reichelt at gcc dot gnu dot org
@ 2009-01-27 18:33 ` ethouris at gmail dot com
  2009-01-27 18:35 ` ethouris at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ethouris at gmail dot com @ 2009-01-27 18:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ethouris at gmail dot com  2009-01-27 18:33 -------
Created an attachment (id=17194)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17194&action=view)
Preprocessed source that caused the problem

The problem is reported for line 40 in msigslot.h, where a 'friend' declaration
is provided (with a variadic-templated function).


-- 


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-01-27 18:33 ` ethouris at gmail dot com
@ 2009-01-27 18:35 ` ethouris at gmail dot com
  2009-02-06 12:51 ` paolo dot carlini at oracle dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ethouris at gmail dot com @ 2009-01-27 18:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ethouris at gmail dot com  2009-01-27 18:35 -------
I added as attachment the code that causes the same error message.

Please note that this code was compiling and working correctly with the old
Doug Gregor's patch, which was the first version of 'variadic template'
feature.
I'd suggest you check why it was working there.


-- 


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-01-27 18:35 ` ethouris at gmail dot com
@ 2009-02-06 12:51 ` paolo dot carlini at oracle dot com
  2009-02-07  2:05 ` paolo at gcc dot gnu dot org
  2009-02-07  2:08 ` paolo dot carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-02-06 12:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from paolo dot carlini at oracle dot com  2009-02-06 12:51 -------
On it.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
                   |dot org                     |dot com
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-02-06 12:51 ` paolo dot carlini at oracle dot com
@ 2009-02-07  2:05 ` paolo at gcc dot gnu dot org
  2009-02-07  2:08 ` paolo dot carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: paolo at gcc dot gnu dot org @ 2009-02-07  2:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from paolo at gcc dot gnu dot org  2009-02-07 02:05 -------
Subject: Bug 37737

Author: paolo
Date: Sat Feb  7 02:05:04 2009
New Revision: 144001

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144001
Log:
/cp
2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35147
        PR c++/37737
        * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.

/testsuite
2009-02-06  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/35147
        PR c++/37737
        * g++.dg/cpp0x/vt-35147.C: New.
        * g++.dg/cpp0x/vt-37737-1.C: Likewise.
        * g++.dg/cpp0x/vt-37737-2.C: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-35147.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-37737-1.C
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction
  2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-02-07  2:05 ` paolo at gcc dot gnu dot org
@ 2009-02-07  2:08 ` paolo dot carlini at oracle dot com
  10 siblings, 0 replies; 12+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-02-07  2:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from paolo dot carlini at oracle dot com  2009-02-07 02:08 -------
Fixed for 4.4.0.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.4.0


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


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

end of thread, other threads:[~2009-02-07  2:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-05 10:55 [Bug c++/37737] New: ICE on variadic template function cfairles at gcc dot gnu dot org
2008-10-05 12:03 ` [Bug c++/37737] " cfairles at gcc dot gnu dot org
2008-10-05 12:10 ` cfairles at gcc dot gnu dot org
2008-10-08 14:07 ` [Bug c++/37737] [c++0x] ICE in get_innermost_template_args at cp/pt.c:516 during variadic function overload deduction cfairles at gcc dot gnu dot org
2008-10-24 11:47 ` cfairles at gcc dot gnu dot org
2008-12-24 20:22 ` pinskia at gcc dot gnu dot org
2008-12-28 22:55 ` reichelt at gcc dot gnu dot org
2009-01-27 18:33 ` ethouris at gmail dot com
2009-01-27 18:35 ` ethouris at gmail dot com
2009-02-06 12:51 ` paolo dot carlini at oracle dot com
2009-02-07  2:05 ` paolo at gcc dot gnu dot org
2009-02-07  2:08 ` paolo dot carlini at oracle dot com

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