This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/2238: Use of a class member constant as a size for a member array creation is not handled and causes an Internal compiler error in weird places.
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/2238: Use of a class member constant as a size for a member array creation is not handled and causes an Internal compiler error in weird places.
- From: mat dot hounsell at excite dot com
- Date: 9 Mar 2001 04:28:02 -0000
- Reply-To: mat dot hounsell at excite dot com
>Number: 2238
>Category: c++
>Synopsis: Use of a class member constant as a size for a member array creation is not handled and causes an Internal compiler error in weird places.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 08 20:36:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Mathew Hounsell
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
SunOS 5.5.1 Generic_103640-34 sun4u sparc sun4u
>Description:
Define a constant as a class member.
Use it in defining a fixed length array class member.
Compiler then falls over in wierd places.
Declaring internal compiler error.
>How-To-Repeat:
typedef unsigned char octet;
class Cell {
typedef octet size_type;
typedef octet value_type;
static const size_type SIZE;
value_type data[ SIZE ];
public:
Cell( void );
void getFirst( void ) const {
return data[0]; // Death - Type I - Internal Compiler Error
}
};
const Cell::size_type Cell::SIZE = 53;
Cell::Cell( void )
{ // Death - Type II - Internal Compiler Error
data[1] = 5;
}
>Fix:
Stop with error report on declaration.
>Release-Note:
>Audit-Trail:
>Unformatted: