bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

g++ 2.8.1 template bug


From: rwitmer
Subject: g++ 2.8.1 template bug
Date: Thu, 8 Mar 2001 08:38:50 -0700

% cat bug.cc
 
template<class T>
class CheckArrayBounds
{
  public:
 
    CheckArrayBounds(T* mem, unsigned int n)
    {
    }
};
 

main()
{
  int array[10];
 
  struct aTestStruct{
    CheckArrayBounds<int> element(array, 10); // OK, so I shouldn't do this, but it generated a fatal error and said report me.
  };
 
}
% g++ bug.cc
bug.cc: In function `int main()':
bug.cc:18: warning: ANSI C++ forbids initialization of member `element'
bug.cc:18: Internal compiler error.
bug.cc:18: Please submit a full bug report to `
address@hidden'.
% g++ -v
Reading specs from /software/gnu/gcc/2.8.1/sun4os5/lib/gcc-lib/sparc-sun-solaris2.6/2.8.1/specs
gcc version 2.8.1

reply via email to

[Prev in Thread] Current Thread [Next in Thread]