This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/106: Re: template bug: internal error.
- To: gcc-gnats at sourceware dot cygnus dot com
- Subject: c++/106: Re: template bug: internal error.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 14 Mar 2000 10:35:07 +0100
- References: <38CDFB5A.D4B52C9@easics.be>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, koen at easics dot be
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 106
>Category: c++
>Synopsis: template bug: internal error.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: analyzed
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Mar 14 01:56:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Koen Deforche <koen@easics.be>
>Release: 2.95.2
>Organization:
Easics nv, Leuven, Belgium, http://www.easics.com
>Environment:
>Description:
Original-Message-ID: <38CDFB5A.D4B52C9@easics.be>
Date: Tue, 14 Mar 2000 09:42:02 +0100
when compiling following code with gcc 2.95 or gcc 2.95.2 on both
linux and solaris platform I get following error:
foo.cc: In function `int main()':
foo.cc:22: Internal compiler error.
foo.cc:22: Please submit a full bug report.
foo.cc:22: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for
instructions.
The problem disappears when
bar<(A::b || B::b)>
is replaced by
bar<or_class<A::b, B::b>::result>
(with a suitable definition for or_class<bool b1, bool b2>).
>How-To-Repeat:
template <bool b> class bar
{
};
class A_a
{
public:
static const bool b = true;
};
class B_b
{
public:
static const bool b = false;
};
template <class A, class B> class foo
{
};
template <class A, class B>
bar<(A::b || B::b)> do_funky(const foo<A, B>&);
int main()
{
bar<true> a_bar = do_funky(foo<A_a, B_b>());
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: