++
Assignee: unassigned at gcc dot gnu.org
Reporter: ofekshilon at gmail dot com
Target Milestone: ---
This code:
int main()
{
int a = 1;
a = ++a ;
}
built with -std=c++17 -Wall (or just -Wsequence-point)
gives:
:4:5: warning: operation on 'a' may be undefined [-Wsequence-po
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ofekshilon at gmail dot com
Target Milestone: ---
The following fails to build with all gcc versions at least since 6.1, when
built with
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106837
--- Comment #2 from Ofek Shilon ---
(In reply to Andrew Pinski from comment #1)
> > In this case the begin/end iter types *are* comparable
> Not exactly as the operator!= requires a lvalue. And end() is not an lvalue.
Then enable comparison als
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106837
--- Comment #4 from Ofek Shilon ---
This can be tested empirically. Remove the entire build_x_binary_op check,
build gcc and run on this snippet. If it builds correctly than the begin/end
types are indeed comparable and the emitted error is fals
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ofekshilon at gmail dot com
Target Milestone: ---
[Migrated from binutils issue
https://sourceware.org/bugzilla/show_bug.cgi?id=32408]
`fun` from this c++ snippet:
```
#include
#include