This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
internal compiler error with templates and union (971225)
- To: egcs-bugs at cygnus dot com
- Subject: internal compiler error with templates and union (971225)
- From: Hans-Helmut Buehmann <hans at expmech dot ing dot tu-bs dot de>
- Date: Sun, 28 Dec 1997 16:28:23 +0100 (CET)
Hello!
Compiling the following code with egcs 1.0 gives an internal compiler
error:
> gcc -o main main.cc
main.cc: In method `char b<INT>::a(int)':
main.cc:7: Internal compiler error.
main.cc:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.
After removing the first line it works.
I used egcs-971225 and linux with glibc-2.0.5c and
./configure --enable-threads --enable-shared
Hans-Helmut Buehmann
H.Buehmann@tu-bs.de
template <class INT>
class b
{
private:
char a(int x)
{
union {
int i;
char c;
} val;
val.i = x;
return val.c;
};
public:
b() {
}
};
int main() {
b<int> n;
return 0;
}