This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
An update on the template bug
- To: mark at markmitchell dot com, jason at cygnus dot com
- Subject: An update on the template bug
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sun, 31 May 1998 18:46:26 +1700 (PDT)
- Cc: egcs at cygnus dot com
Hi,
Here is a simplied version of my last C++ bug report.
# gcc bug.cc
# a.out
zsh: 21222 segmentation fault bug
If I comment out
template class ECKEP<int>;
it compiles and runs fine.
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
class PK_CryptoSystem
{
};
class PK_Encryptor : public virtual PK_CryptoSystem
{
};
class PK_FixedLengthCryptoSystem : public virtual PK_CryptoSystem
{
public:
virtual unsigned int CipherTextLength() const =0;
};
class PK_FixedLengthEncryptor : public virtual PK_Encryptor, public virtual PK_FixedLengthCryptoSystem
{
};
class PK_SignatureSystem
{
public:
virtual ~PK_SignatureSystem() {};
};
class PK_Signer : public virtual PK_SignatureSystem
{
public:
virtual void Sign() = 0;
};
class PK_Verifier : public virtual PK_SignatureSystem
{
};
class PK_Precomputation
{
};
template <class T> class
PK_WithPrecomputation : public T, public virtual PK_Precomputation
{
};
typedef PK_WithPrecomputation<PK_FixedLengthEncryptor> PKWPFLE;
typedef PK_WithPrecomputation<PK_Signer> PKWPS;
template <class EC> class
ECPublicKey : public PKWPFLE
{
public:
unsigned int CipherTextLength() const {}
EC ec;
};
template <class EC>
class ECPrivateKey : public ECPublicKey<EC>, public PKWPS
{
void Sign() {}
int d;
};
template <class EC>
class ECKEP : public ECPrivateKey<EC>
{
};
class GF2NT : public PK_CryptoSystem
{
int t1;
};
class EC2N : public PK_CryptoSystem
{
GF2NT field;
int a;
};
template class ECKEP<EC2N>;
template class ECKEP<int>;
int
main ()
{
ECKEP<EC2N> foo;
return 0;
}