This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

template bug: internal error.


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>());
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]