http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56815



--- Comment #6 from Chung-Ju Wu <jasonwucj at gmail dot com> 2013-04-03 
07:33:03 UTC ---

(In reply to comment #5)

> (In reply to comment #4)

> > From gcc manpage, the option '-std=' specifies base standard and

> > accept some GNU extensions that do not contradict it.

> > 

> > If you would like to issue warnings/errors demanded by strict

> > ISO C and ISO C++, the -pedantic/-pedantic-errors are required.

> 

> Ok, thanks. It works.

> But still. What is the difference between +=1 and ++ ? It's the same 
> operation.



The operation result may be the same. But the grammar parsing is different.

Refer to ISO/IEC 14882:1998 C++ standard, Annex A, Grammar summary.



'+=' is parsed via assignment-expression

'++' is parsed via postfix-expression



I have no idea whether the same checking strategy should be applied

for these two operations. But at least, I guess they are indeed

treated in different way in the parser~ :p

Reply via email to