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]

More template problems (Internal compiler error 980715)


Hello,

    The attached file does the following lovely stuff with egcs 1.1.2
(final) :

miranda(1):~/projects/matrix% /opt/egcs/bin/c++ -o foo2 foo2.cpp
foo2.cpp: In function `class CFoo<double> operator *(const class
CFoo<int> &, const class CFoo<double> &)':
foo2.cpp:17: Internal compiler error 980715.
foo2.cpp:17: Please submit a full bug report to
`egcs-bugs@egcs.cygnus.com'.
foo2.cpp:17: See <URL:http://egcs.cygnus.com/faq.html#bugreport> for
details.
miranda(1):~/projects/matrix% /opt/egcs/bin/c++ --version
egcs-2.91.63
miranda(0):~/projects/matrix% uname -a
SunOS miranda 5.7 Generic i86pc i386 i86pc

    I'm not sure if this is related to the last bug report I sent, but
that was with 1.1.2-pre3 and I assume
that the fix went in before the final version came out.

    This is an incomplete example (OpMultiply isn't defined in here
because you can trigger the error
without it).  If you want the rest, just ask.


--
James Macnicol
j-macnicol@adfa.edu.au
template <class T>
class CFoo {
public:
  CFoo(T *vals) { m_Vals = vals; }
private:
  T *m_Vals;
};

template <class Result, class T, class U>
Result OpMultiply(const T &v1, const U &v2)
{
  return (static_cast<Result>(v1) * static_cast<Result>(v2));
}

CFoo<double> operator*(const CFoo<int> &a1, const CFoo<double> &a2)
{
  return (CFoo<double>(ApplyOperator(a1, a2, OpMultiply<double, int, double>)));
}

int main(void)
{
  return (0);
}

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