This is the mail archive of the gcc-prs@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]

c++/106: Re: template bug: internal error.



>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:

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