public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code
@ 2005-07-11  9:53 martin at mpa-garching dot mpg dot de
  2005-07-11 10:47 ` [Bug c++/22405] " martin at mpa-garching dot mpg dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2005-07-11  9:53 UTC (permalink / raw)
  To: gcc-bugs

Current g++ produces an ICE when compiling the following code snippet:

template <typename T> void foo(T &arg) {
  arg+=1;
  }

template <typename T> void foo(T &arg) {
  arg+=2;
  }

template void foo(float &arg);


~/tmp>g++ -v bug.cc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /scratch/gcc/configure --quiet
--prefix=/afs/mpa/data/martin/ugcc --enable-languages=c++,f95
--enable-mapped-location --with-gmp=/afs/mpa/data/martin/mygmp
Thread model: posix
gcc version 4.1.0 20050711 (experimental)
 /afs/mpa/data/martin/ugcc/libexec/gcc/i686-pc-linux-gnu/4.1.0/cc1plus -quiet -v
-D_GNU_SOURCE bug.cc -quiet -dumpbase bug.cc -mtune=pentiumpro -auxbase bug
-version -o /tmp/cctt6fLt.s
ignoring nonexistent directory
"/afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../include/c++/4.1.0
 /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../include/c++/4.1.0/i686-pc-linux-gnu
 /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../include/c++/4.1.0/backward
 /usr/local/include
 /afs/mpa/data/martin/ugcc/include
 /afs/mpa/data/martin/ugcc/lib/gcc/i686-pc-linux-gnu/4.1.0/include
 /usr/include
End of search list.
GNU C++ version 4.1.0 20050711 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.0 20050711 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 4d7d2981a00322530f4db8cbc706d5cf
bug.cc:5:38: error: redefinition of 'template<class T> void foo(T&)'
bug.cc:1:38: error: 'template<class T> void foo(T&)' previously declared here
bug.cc:9:29: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 
           Summary: ICE in when instantiating a template function, for
                    illegal code
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin at mpa-garching dot mpg dot de
                CC: gcc-bugs at gcc dot gnu dot org,martin at mpa-garching
                    dot mpg dot de
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/22405] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
@ 2005-07-11 10:47 ` martin at mpa-garching dot mpg dot de
  2005-07-11 14:42 ` [Bug c++/22405] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: martin at mpa-garching dot mpg dot de @ 2005-07-11 10:47 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
      Known to fail|                            |4.1.0
      Known to work|                            |4.0.1


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


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

* [Bug c++/22405] [4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
  2005-07-11 10:47 ` [Bug c++/22405] " martin at mpa-garching dot mpg dot de
@ 2005-07-11 14:42 ` pinskia at gcc dot gnu dot org
  2005-07-11 15:58 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 14:42 UTC (permalink / raw)
  To: gcc-bugs

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 14:28 -------
I don't get any ICE with a build last night:
GNU C++ version 4.1.0 20050711 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.0 20050711 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: c31b6346e19edf60575edbc32c6610bc
t.cc:5: error: redefinition of ‘template<class T> void foo(T&)’
t.cc:1: error: ‘template<class T> void foo(T&)’ previously declared here
earth:~>

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
           Keywords|                            |error-recovery
            Summary|ICE in when instantiating a |[4.1 Regression] ICE in when
                   |template function, for      |instantiating a template
                   |illegal code                |function, for illegal code
   Target Milestone|---                         |4.1.0


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


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

* [Bug c++/22405] [4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
  2005-07-11 10:47 ` [Bug c++/22405] " martin at mpa-garching dot mpg dot de
  2005-07-11 14:42 ` [Bug c++/22405] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-07-11 15:58 ` pinskia at gcc dot gnu dot org
  2005-07-11 16:02 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 15:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 15:57 -------
Confirmed, I missed part of the testcase when testing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to work|4.0.1                       |4.0.1 4.0.0 3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-11 15:57:55
               date|                            |


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


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

* [Bug c++/22405] [4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
                   ` (2 preceding siblings ...)
  2005-07-11 15:58 ` pinskia at gcc dot gnu dot org
@ 2005-07-11 16:02 ` pinskia at gcc dot gnu dot org
  2005-07-25 13:41 ` [Bug c++/22405] [4.0.1/4.1 " reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-11 16:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-11 15:58 -------
Here is the backtrace:
#0  most_specialized_instantiation (instantiations=0xb7d84570) at /home/peshtigo/pinskia/src/gnu/
gcc/src/gcc/cp/pt.c:10723
#1  0x080a071b in determine_specialization (template_id=0xb7ce5168, decl=0xb7d82a80, 
targs_out=0xbff9dc08, need_member_template=0, 
    template_count=0) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/pt.c:10789
#2  0x080aae5c in check_explicit_specialization (declarator=0xb7ce5168, decl=Variable "decl" is not 
available.
)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/pt.c:2010
#3  0x0806a6d3 in grokfndecl (ctype=0x0, type=Variable "type" is not available.
) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/decl.c:5734
#4  0x08078576 in grokdeclarator (declarator=0x876f554, declspecs=0xbff9dd9c, 
decl_context=NORMAL, initialized=0, attrlist=0x0)
    at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/cp/decl.c:8127


-- 


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


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

* [Bug c++/22405] [4.0.1/4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
                   ` (3 preceding siblings ...)
  2005-07-11 16:02 ` pinskia at gcc dot gnu dot org
@ 2005-07-25 13:41 ` reichelt at gcc dot gnu dot org
  2005-07-25 13:54 ` reichelt at gcc dot gnu dot org
  2005-09-27 15:59 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-25 13:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2005-07-25 13:40 -------
The problem now also appears on the 4.0 branch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
      Known to fail|4.1.0                       |4.0.1 4.1.0
      Known to work|4.0.1 4.0.0 3.4.0           |4.0.0 3.4.0
            Summary|[4.1 Regression] ICE in when|[4.0.1/4.1 Regression] ICE
                   |instantiating a template    |in when instantiating a
                   |function, for illegal code  |template function, for
                   |                            |illegal code


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


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

* [Bug c++/22405] [4.0.1/4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
                   ` (4 preceding siblings ...)
  2005-07-25 13:41 ` [Bug c++/22405] [4.0.1/4.1 " reichelt at gcc dot gnu dot org
@ 2005-07-25 13:54 ` reichelt at gcc dot gnu dot org
  2005-09-27 15:59 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-07-25 13:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.0                       |4.0.2


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


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

* [Bug c++/22405] [4.0.1/4.1 Regression] ICE in when instantiating a template function, for illegal code
  2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
                   ` (5 preceding siblings ...)
  2005-07-25 13:54 ` reichelt at gcc dot gnu dot org
@ 2005-09-27 15:59 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 15:59 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 15:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-11  9:53 [Bug c++/22405] New: ICE in when instantiating a template function, for illegal code martin at mpa-garching dot mpg dot de
2005-07-11 10:47 ` [Bug c++/22405] " martin at mpa-garching dot mpg dot de
2005-07-11 14:42 ` [Bug c++/22405] [4.1 Regression] " pinskia at gcc dot gnu dot org
2005-07-11 15:58 ` pinskia at gcc dot gnu dot org
2005-07-11 16:02 ` pinskia at gcc dot gnu dot org
2005-07-25 13:41 ` [Bug c++/22405] [4.0.1/4.1 " reichelt at gcc dot gnu dot org
2005-07-25 13:54 ` reichelt at gcc dot gnu dot org
2005-09-27 15:59 ` mmitchel at gcc dot gnu dot 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).