This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template bug: internal error.
- To: gcc-bugs at gcc dot gnu dot org
- Subject: template bug: internal error.
- From: Koen Deforche <koen at easics dot be>
- Date: Tue, 14 Mar 2000 09:42:02 +0100
- Organization: Easics nv, Leuven, Belgium, http://www.easics.com
Hi,
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>).
greetings,
koen.
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>());
}