public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14507] New: [3.1/3.2/3.2.2/3.2.3/3.3.2/3.3.3 Regression From 2.95.2/2.95.3] Wacky Template ICE
@ 2004-03-09 19:25 stl at caltech dot edu
  2004-03-09 19:41 ` [Bug c++/14507] [3.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: stl at caltech dot edu @ 2004-03-09 19:25 UTC (permalink / raw)
  To: gcc-bugs

This bug was found by John Saalweachter, saalweaj@purdue.edu ; I reduced the 
test case and agreed to submit a PR. I have no clue whether the test case is 
valid or not.

The following test case ICEs when compiled with g++ -c:

template <typename A, typename B = int, typename C = int, typename D = int>
struct c : virtual c<A, B> { };

template <typename A, typename B, typename C>
struct c<A, B, C, int> : c<A, B> {
    c() : c() { }
};

I observe the ICE with:
i686-pc-linux-gnu 3.3.2
sparc-sun-solaris2.7 3.2.3
i686-pc-linux-gnu 3.2.2
i386-redhat-linux 3.2.2
i686-pc-linux-gnu 3.1
i686-pc-linux-gnu 3.2

John Saalweachter observes the ICE with:
i686-pc-linux-gnu 3.3.3
i386-slackware-linux 3.2
i486-slackware-linux 3.2.3 

All of these ICEs occur with no other output. For example, my i686-pc-linux-
gnu 3.3.2 emits:

g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

I observe a clean compile (no ICE, no complaining) with:
i686-pc-linux-gnu 2.95.3

John Saalweachter also observes a clean compile with:
sparc-sun-solaris2.8 2.95.2

Here are three less reduced test cases that also ICE (on my i686-pc-linux-gnu 
3.3.2; I don't know about other systems for these test cases):

[FIRST]
struct s { };
s foo;

template <typename T, s &i0 = foo, s &i1 = foo, s &i2 = foo>
class c : virtual public c<T, i0> { };

template <typename T, s &i0, s &i1>
class c<T, i0, i1, foo> : public c<T, i0> {
public:
    c (const T &i) : c<T> (i) { }
};

[SECOND]
struct s { };

template <typename T, typename i0 = s, typename i1 = s, typename i2 = s>
class c : virtual public c<T, i0> { };

template <typename T, typename i0, typename i1>
class c<T, i0, i1, s> : public c<T, i0> {
public:
  c (const T &i) : c<T> (i) { }
};

[THIRD]
struct s { };

template <typename A, typename B = s, typename C = s, typename D = s>
struct c : virtual c<A, B> { };

template <typename A, typename B, typename C>
struct c<A, B, C, s> : c<A, B> {
  c(const A &i) : c<A> (i) { }
};

-- 
           Summary: [3.1/3.2/3.2.2/3.2.3/3.3.2/3.3.3 Regression From
                    2.95.2/2.95.3] Wacky Template ICE
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stl at caltech dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 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=14507


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <20040309192501.14507.stl@nuwen.net>]

end of thread, other threads:[~2005-01-21  4:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-09 19:25 [Bug c++/14507] New: [3.1/3.2/3.2.2/3.2.3/3.3.2/3.3.3 Regression From 2.95.2/2.95.3] Wacky Template ICE stl at caltech dot edu
2004-03-09 19:41 ` [Bug c++/14507] [3.3 Regression] " pinskia at gcc dot gnu dot org
2004-03-09 20:36 ` bangerth at dealii dot org
2004-04-01 19:40 ` bangerth at dealii dot org
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-08-10 19:07 ` reichelt at gcc dot gnu dot org
     [not found] <20040309192501.14507.stl@nuwen.net>
2004-09-28 13:27 ` gdr at gcc dot gnu dot org
2005-01-21  4:17 ` gdr 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).