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]

internal compiler error with templates and union (971225)


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;
}



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