public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35374]  New: ICE during instanciation of a template expr. with typeof()
@ 2008-02-26 10:42 philippe dot hoogvorst at neuf dot fr
  2008-02-26 10:58 ` [Bug c++/35374] " pcarlini at suse dot de
  0 siblings, 1 reply; 2+ messages in thread
From: philippe dot hoogvorst at neuf dot fr @ 2008-02-26 10:42 UTC (permalink / raw)
  To: gcc-bugs

The following code:

// START of CODE, FILE 'try.cpp'
template<class A,class B> 
typeof(A(0)+B(0)) add( A a , B b )
{
        return a + b;
}

void f( double & S , double X , int Y )
{
        S = add( X , Y );
}
// END OF CODE

causes g++ to emit an ICE error, as shown of the following sessions transcript.
I joined the try.ii file even if I think it can be easily re-created, as the
bug-triggering code contains non "#include<...>" statement.

-----------------------------------------------------------------------------------------
> gcc -v -save-temps try.cpp
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
 /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1plus -E -quiet -v -D_GNU_SOURCE try.cpp
-mtune=i686 -fpch-preprocess -o try.ii
ignoring nonexistent directory "/usr/local/include/i486-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../i486-linux-gnu/include"
ignoring nonexistent directory "/usr/include/i486-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/i486-linux-gnu
 /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward
 /usr/local/include
 /usr/lib/gcc/i486-linux-gnu/4.1.2/include
 /usr/include
End of search list.
 /usr/lib/gcc/i486-linux-gnu/4.1.2/cc1plus -fpreprocessed try.ii -quiet
-dumpbase try.cpp -mtune=i686 -auxbase try -version -o try.s
GNU C++ version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (i486-linux-gnu)
        compiled by GNU C version 4.1.2 20061115 (prerelease) (Debian
4.1.1-21).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64575
Compiler executable checksum: 183d42a838ed2b7313bffcb8f2f2fda7
try.cpp: In function '__typeof__ (((A)(0) + (B)(0))) add(A, B) [with A =
double, B = int]':
try.cpp:4: internal compiler error: in write_type, at cp/mangle.c:1651
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccAaaM0z.out file, please attach this to
your bugreport.
-----------------------------------------------------------------------------------------
> cat try.ii 
# 1 "try.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "try.cpp"
template<class A,class B>
typeof(A(0)+B(0)) add( A a , B b )
{
 return a + b;
}

void f( double & S , double X , int Y )
{
 S = add( X , Y );
}
-----------------------------------------------------------------------------------------


-- 
           Summary: ICE during instanciation of a template expr. with
                    typeof()
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: philippe dot hoogvorst at neuf dot fr
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


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


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

* [Bug c++/35374] ICE during instanciation of a template expr. with typeof()
  2008-02-26 10:42 [Bug c++/35374] New: ICE during instanciation of a template expr. with typeof() philippe dot hoogvorst at neuf dot fr
@ 2008-02-26 10:58 ` pcarlini at suse dot de
  0 siblings, 0 replies; 2+ messages in thread
From: pcarlini at suse dot de @ 2008-02-26 10:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pcarlini at suse dot de  2008-02-26 10:57 -------


*** This bug has been marked as a duplicate of 13740 ***


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2008-02-26 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-26 10:42 [Bug c++/35374] New: ICE during instanciation of a template expr. with typeof() philippe dot hoogvorst at neuf dot fr
2008-02-26 10:58 ` [Bug c++/35374] " pcarlini at suse dot de

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