This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: const without initor wrongly permitted ?


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]