public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
@ 2011-01-17  8:02 schmidt-thieme at ismll dot de
  2011-01-17 11:31 ` [Bug c++/47326] " paolo.carlini at oracle dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: schmidt-thieme at ismll dot de @ 2011-01-17  8:02 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE in tsubst_copy (triggered by dependency of return
                    type on parameter pack size)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schmidt-thieme@ismll.de


gcc (snapshot gcc-4.6-20110115) throws an internal compiler error when 
compiling the attached file
"bug-gcc-ICE-return_type_depends_on_variadic_size.ii"

> g++ -std=c++0x bug-gcc-ICE-return_type_depends_on_variadic_size.ii
bug-gcc-ICE-return_type_depends_on_variadic_size.cpp: In function ‘int main()’:
bug-gcc-ICE-return_type_depends_on_variadic_size.cpp:12:8: internal compiler
error:
 in tsubst_copy, at cp/pt.c:11242    

This bug is similar, but not identical to  
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47289
reported a couple of days ago by me and meanwhile fixed by Jason 
Merrill -- thank you a a lot ! (as gcc/testsuite/g++.dg/cpp0x/variadic105.C 
now does not throw an ICE anymore.)

gcc was build from source and configured via
> configure --prefix=/opt/prog/gcc/ -enable-languages=c,c++,fortran --disable-multilib
on ubuntu
> uname -a
Linux lst-desktop 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 05:14:15 UTC 2010
x86_64 GNU/Linux


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

* [Bug c++/47326] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
@ 2011-01-17 11:31 ` paolo.carlini at oracle dot com
  2011-01-17 16:03 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-01-17 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-01-17 10:13:14 UTC ---
Let's add Jason in CC for this one too.


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

* [Bug c++/47326] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
  2011-01-17 11:31 ` [Bug c++/47326] " paolo.carlini at oracle dot com
@ 2011-01-17 16:03 ` hjl.tools at gmail dot com
  2011-01-17 22:34 ` schmidt-thieme at ismll dot de
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-17 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011.01.17 15:49:07
     Ever Confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-17 15:49:07 UTC ---
Where is the attached file?


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

* [Bug c++/47326] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
  2011-01-17 11:31 ` [Bug c++/47326] " paolo.carlini at oracle dot com
  2011-01-17 16:03 ` hjl.tools at gmail dot com
@ 2011-01-17 22:34 ` schmidt-thieme at ismll dot de
  2011-01-18 14:21 ` [Bug c++/47326] [4.4/4.5/4.6 Regression] " hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: schmidt-thieme at ismll dot de @ 2011-01-17 22:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Lars Schmidt-Thieme <schmidt-thieme at ismll dot de> 2011-01-17 21:52:18 UTC ---
Created attachment 23006
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23006
file producing the ICE

sorry


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (2 preceding siblings ...)
  2011-01-17 22:34 ` schmidt-thieme at ismll dot de
@ 2011-01-18 14:21 ` hjl.tools at gmail dot com
  2011-02-08 14:16 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2011-01-18 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Target Milestone|---                         |4.4.6
            Summary|ICE in tsubst_copy          |[4.4/4.5/4.6 Regression]
                   |(triggered by dependency of |ICE in tsubst_copy
                   |return type on parameter    |(triggered by dependency of
                   |pack size)                  |return type on parameter
                   |                            |pack size)

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-18 14:13:14 UTC ---
It is caused by revision 145013:

http://gcc.gnu.org/ml/gcc-cvs/2009-03/msg00520.html


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (3 preceding siblings ...)
  2011-01-18 14:21 ` [Bug c++/47326] [4.4/4.5/4.6 Regression] " hjl.tools at gmail dot com
@ 2011-02-08 14:16 ` rguenth at gcc dot gnu.org
  2011-02-08 14:36 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-08 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-08 14:13:31 UTC ---
Calling this a regression is interesting.  GCC 4.3 rejects the code:

> /space/rguenther/install/gcc-4.3.5/bin/g++ -S t.ii -std=c++0x
../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp:7:
error: expected initializer before '->' token
../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp: In
function 'int main()':
../src/simple-tests/bug-gcc-ICE-return_type_depends_on_variadic_size.cpp:12:
error: 'f' was not declared in this scope

it remains to be stated whether the code is valid or not, ICEing instead
of rejecting it is a regression.


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (4 preceding siblings ...)
  2011-02-08 14:16 ` rguenth at gcc dot gnu.org
@ 2011-02-08 14:36 ` redi at gcc dot gnu.org
  2011-02-16 13:39 ` [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] " dodji at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2011-02-08 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-02-08 14:30:36 UTC ---
The code is valid C++0x (so the summary should include [C++0x])

It doesn't ICE if sizeof...(_ARGS) is used instead of sizeof...(args), or if
the sizeof... expression occurs in the function body rather than the
trailing-return-type

e.g this compiles:

template <int> struct A { };

template <typename... _ARGS>
auto f (_ARGS... args) -> A<sizeof...(_ARGS)> {
  return {};
}

int main() {
  f(1,2);
}

and so does this:

template <int> struct A { };

template <typename... _ARGS>
A<2> f (_ARGS... args) {
  return A<sizeof...(args)>{};
}

int main() {
  f(1,2);
}

but not this:

template <int> struct A { };

template <typename... _ARGS>
auto f (_ARGS... args) -> A<sizeof...(args)> {
  return {};
}

int main() {
  f(1,2);
}


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (5 preceding siblings ...)
  2011-02-08 14:36 ` redi at gcc dot gnu.org
@ 2011-02-16 13:39 ` dodji at gcc dot gnu.org
  2011-02-16 16:31 ` dodji at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-16 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |dodji at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (6 preceding siblings ...)
  2011-02-16 13:39 ` [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] " dodji at gcc dot gnu.org
@ 2011-02-16 16:31 ` dodji at gcc dot gnu.org
  2011-02-16 20:45 ` dodji at gcc dot gnu.org
  2011-02-16 21:09 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-16 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-16 16:30:22 UTC ---
Candidate patch posted to
http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01050.html


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (7 preceding siblings ...)
  2011-02-16 16:31 ` dodji at gcc dot gnu.org
@ 2011-02-16 20:45 ` dodji at gcc dot gnu.org
  2011-02-16 21:09 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-16 20:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-16 20:45:18 UTC ---
Author: dodji
Date: Wed Feb 16 20:45:15 2011
New Revision: 170222

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170222
Log:
PR c++/47326

gcc/cp/

    PR c++/47326
    * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack
    expansion arguments are not evaluated.

gcc/testsuite/

    PR c++/47326
    * g++.dg/cpp0x/variadic106.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/variadic106.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] ICE in tsubst_copy (triggered by dependency of return type on parameter pack size)
  2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
                   ` (8 preceding siblings ...)
  2011-02-16 20:45 ` dodji at gcc dot gnu.org
@ 2011-02-16 21:09 ` dodji at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: dodji at gcc dot gnu.org @ 2011-02-16 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #12 from Dodji Seketeli <dodji at gcc dot gnu.org> 2011-02-16 21:08:43 UTC ---
Fixed in trunk (4.6).


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

end of thread, other threads:[~2011-02-16 21:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17  8:02 [Bug c++/47326] New: ICE in tsubst_copy (triggered by dependency of return type on parameter pack size) schmidt-thieme at ismll dot de
2011-01-17 11:31 ` [Bug c++/47326] " paolo.carlini at oracle dot com
2011-01-17 16:03 ` hjl.tools at gmail dot com
2011-01-17 22:34 ` schmidt-thieme at ismll dot de
2011-01-18 14:21 ` [Bug c++/47326] [4.4/4.5/4.6 Regression] " hjl.tools at gmail dot com
2011-02-08 14:16 ` rguenth at gcc dot gnu.org
2011-02-08 14:36 ` redi at gcc dot gnu.org
2011-02-16 13:39 ` [Bug c++/47326] [4.4/4.5/4.6 Regression][C++0x] " dodji at gcc dot gnu.org
2011-02-16 16:31 ` dodji at gcc dot gnu.org
2011-02-16 20:45 ` dodji at gcc dot gnu.org
2011-02-16 21:09 ` dodji 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).