This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bool bug? Pls confirm.
- To: egcs-bugs at cygnus dot com
- Subject: bool bug? Pls confirm.
- From: "Glenn R. Kronschnabl" <grk at arlut dot utexas dot edu>
- Date: Mon, 02 Feb 1998 10:27:19 -0600
Is the bool initialization code broken? Can someone pls confirm whether this
is a bug or not. If its not, I want to change my code.
The following code does not work with egcs-1.0.1 or with gcc-2.7.2.X
for that matter. But if you uncomment the 'const int' line and comment out
the 'const bool' line, then it compiles fine.
% g++ -c b.cc
b.cc:6: field initializer is not constant
--- b.cc ---
struct X
{
// static const int is_signed = true ;
static const bool is_signed = true ;
static const int digits = is_signed ? 8 *sizeof(wchar_t)-1 : 0;
};
% g++ -c c.cc
--- c.cc ---
struct X
{
static const int is_signed = true ;
// static const bool is_signed = true ;
static const int digits = is_signed ? 8 *sizeof(wchar_t)-1 : 0;
};
Cheers,
Glenn
--------------------
Glenn R. Kronschnabl
Applied Research Laboratories | grk@arlut.utexas.edu (PGP/MIME ok)
The University of Texas at Austin | http://www.arlut.utexas.edu/~grk
PO Box 8029, Austin, TX 78713-8029 | (Ph) 512.835.3642 (FAX) 512.835.3808
10,000 Burnet Road, Austin, TX 78758 | ... but an Aggie at heart!