This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: const without initor wrongly permitted ?
- To: dcb at pncl dot co dot uk
- Subject: Re: const without initor wrongly permitted ?
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Sun, 11 Oct 1998 13:01:40 -0700
- CC: egcs-bugs at cygnus dot com
- References: <199810111725.SAA08150@fm215.facility.pipex.com>
- Reply-to: mark at markmitchell dot com
>>>>> "David" == David C Binderman <dcb@pncl.co.uk> writes:
David> Hello there,
David> I tried out the following C++ code on egcs-19981005 on
David> Linux/ Alpha, and was much surprised to see that it
David> compiled fine, even with compiler options -ansi -pedantic.
David> My understanding is that the code should not compile, since
David> the contents of the array are const, and no initialiser is
David> provided.
David> void f() { const int var [ 10 ]; }
This is almost certainly the same bug as you reported yesterday;
essentially, cv-qualification of array types is presently broken in
g++. I will fix it shortly; I am hoping to leverage some new macros
in the syntax-checking portion of the `restrict' patch I submitted
recently. When the fate of that patch is decided, I will fix these
g++ bugs, at the same time as adding support for `restrict' in C++, if
the `restrict' patch is accepted.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com