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]
Other format: [Raw text]

Re: [Bug c++/22248] New: Incorrect work with multiple assigment.


"algorithmus at gmail dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| ---new.cpp----
| #include<cstdio>
| 
| #define swap(a,b) a^=b^=a^=b

You're modifying objects more than once without intervening sequence
points.  All bets are off. There is a standard utility std::swap() from
<utility> that works all the time.
PR invalid.

-- Gaby


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