This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ 2.7.2.3 says «Unterminated string» ininline function containing terminated string with letters above 127d
- To: trond at ramstind dot gtf dot ol dot no
- Subject: Re: g++ 2.7.2.3 says «Unterminated string» ininline function containing terminated string with letters above 127d
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 27 Mar 2000 20:30:56 +0200
- CC: bug-gcc at gnu dot org
- References: <Pine.BSF.4.21.0003271745110.73624-100000@ramstind.gtf.ol.no>
> I also discovered another possible bug. I may be abusing the C++
> language, but I think it is a bug either way:
>
> class c {
> const int MinValue = -100;
> const int MaxValue = +200;
> };
>
> Compiled with gcc -Wall -c, gcc says:
> morebugs.cc:3: field initializer is not constant
>
> If I remove the (redundant) + before 200, the code compiles OK.
> 200 is the same as +200, and in my opinion so should the compiler
> think.
gcc 2.95.2 correctly says
a.cc:2: ANSI C++ forbids initialization of member `MinValue'
a.cc:2: making `MinValue' static
a.cc:3: ANSI C++ forbids initialization of member `MaxValue'
a.cc:3: making `MaxValue' static
whether you have the redundant plus or not. I really recommend
updating your compiler - there is no point in reporting bugs for g++
2.7.
Regards,
Martin