This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template specialisation make computer crash
- From: Jérémie Turbet <JeT at laposte dot net>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: jeremie dot turbet at loria dot fr
- Date: Thu, 7 Aug 2003 11:35:32 +0200
- Subject: template specialisation make computer crash
- Reply-to: JeT at laposte dot net
gcc version : (g++ --version)
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
standard version thas is installed with RH9.0
system version : (/proc/version)
Linux version 2.4.20-8 (bhcompile@stripples.devel.redhat.com) (gcc version
3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Mar 13 17:18:24 EST 2003
system version: (/etc/redhat-release)
Red Hat Linux release 9 (Shrike)
compilation command line :
g++ -o templateBug templateBug.c++
compiler output:
I cannot get it, because my computer crash when compiling...
sources :
include file:
// ----------------------------------------------------------------------
#include <iostream>
template<typename T>
class Container
{
public:
Container<T>(T const &t);
private:
T content;
};
template<typename T>
Container<T>::Container(T const &t)
{
std::cout << "create a generic container with value " << t << std::endl;
content=t;
}
template<float>
Container<float>::Container(float const &t)
{
std::cout << "create a float-specific container with value " << t <<
std::endl;
content=t;
}
// ----------------------------------------------------------------------
source code :
// ----------------------------------------------------------------------
#include "template.h"
#include <iostream>
int main(void)
{
Container<int> intContainer(5);
Container<float> floatContainer(5.5);
return 0;
}
// ----------------------------------------------------------------------
problem context:
I was trying to learn specialisation of templates.
The syntax of this test program can be incorrect.
g++ makes my computer getting very sloooooow (hard drive is always in red)
and after a long delay, nothing else happen. I must reboot.
g++ puts some error outputs, but because of the crash, I cannot get them ...
I'm not used with bug reporting... (it's my first one)
Do not hesitate to contact me for further informations
cheers
JeT.