public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11148] New: Incorrect codegen for explicit template instantiation, with ICE for error cases
@ 2003-06-11  3:44 oneill+gccbugs@cs.hmc.edu
  2003-06-11  3:46 ` [Bug c++/11148] " oneill+gccbugs@cs.hmc.edu
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: oneill+gccbugs@cs.hmc.edu @ 2003-06-11  3:44 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Incorrect codegen for explicit template instantiation,
                    with ICE for error cases
           Product: gcc
           Version: 3.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: oneill+gccbugs@cs.hmc.edu
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

The following code generates no output in GCC 3.3, and correct output for 3.2.3

--- Begin Sample Code ---------------------
template <typename X>
class Foo {
    int i;
public:
    Foo() {
#ifdef KILL_GCC_3_3
        X::explode();
#endif
    }
};

class Bar {
    Foo<int> foo_;
public:
    Bar() {}
};

template class Foo<int>;

--- End Sample Code -----------------------


If compiled with -DKILL_GCC_3_3, instead of reporting the error

buglet.cc: In constructor `Foo<X>::Foo() [with X = int]':
buglet.cc:11:   instantiated from here
buglet.cc:5: `int' is not an aggregate type

(which is what 3.2.1 does) it dies with

buglet.cc: In constructor `Foo<X>::Foo() [with X = int]':
buglet.cc:11:   instantiated from here
buglet.cc:5: 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.


Verified on Linux and Mac OS X.

linux% gcc -v
Reading specs from /usr/local/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc-3.3/configure --prefix=/usr/local/gcc-3.3 --enable-languages=c,c++
Thread model: posix
gcc version 3.3

osx% gcc -v
Reading specs from /usr/local/gcc/lib/gcc-lib/powerpc-apple-darwin6.6/3.3/specs
Configured with: ../gcc-3.3/configure --prefix /usr/local/gcc --enable-languages=c,c++
Thread model: single
gcc version 3.3


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

end of thread, other threads:[~2003-07-01 17:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-11  3:44 [Bug c++/11148] New: Incorrect codegen for explicit template instantiation, with ICE for error cases oneill+gccbugs@cs.hmc.edu
2003-06-11  3:46 ` [Bug c++/11148] " oneill+gccbugs@cs.hmc.edu
2003-06-11  3:55 ` oneill+gccbugs@cs.hmc.edu
2003-06-11  4:03 ` pinskia@physics.uc.edu
2003-06-11  4:14 ` pinskia@physics.uc.edu
2003-06-11  4:17 ` pinskia@physics.uc.edu
2003-06-11 15:25 ` bangerth@dealii.org
2003-06-11 22:56 ` pinskia@physics.uc.edu
2003-07-01 17:39 ` 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).