This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Incorrect error message
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Incorrect error message
- From: Loring Holden <lsh at lsh dot cs dot brown dot edu>
- Date: Fri, 3 Sep 1999 10:41:34 -0400
- Cc: lsh at cs dot brown dot edu
I'm getting what I think is an incorrect error message using g++ built from
CVS sources as of Sep. 3 9:27 am EDT.
The system is i686-pc-linux-gnu and I'm using gcc version 2.96 19990903
(experimental)
The source:
bool bool_ret() { return true; }
void
test()
{
static const bool RADJUST = bool_ret() ? true : false;
}
The error:
test.C: In function `void test()':
test.C:6: assignment of read-only variable `RADJUST'
Thanks,
Loring
PS -
output of: g++ -v --save-temps test.C
Reading specs from /u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 19990903 (experimental)
/u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=96 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ test.C test.ii
GNU CPP version 2.96 19990903 (experimental) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/../../../../include/g++-3
/u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/../../../../i686-pc-linux-gnu/include
/u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/local/include
End of omitted list.
/u/lsh/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/cc1plus test.ii -quiet -dumpbase test.cc -version -o test.s
GNU C++ version 2.96 19990903 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 2.96 19990903 (experimental).
test.C: In function `void test()':
test.C:6: assignment of read-only variable `RADJUST'
The test.ii file is virtually the same as test.C so I'm not including it.