[Bug c++/91415] Invalid warning for C++17 sequencing of shift operator E1<<E2.
nico at josuttis dot de
gcc-bugzilla@gcc.gnu.org
Thu Dec 10 16:38:16 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91415
--- Comment #13 from Nicolai Josuttis <nico at josuttis dot de> ---
Oh, sorry, your are right, the example indeed works.
BUT: I used in fact a slightly different example
(sorry, didn't expect that there is a difference):
int main() {
int i = 0;
int j = i++ << i++; // OK, NO WARNING
std::cout << i++ << i++; // still WARNING
}
see https://wandbox.org/permlink/ioZnOv3oAp5F0BsQ
According to my understanding the warning should especially
also not come when we pass i++ twice to std::cout
(to sequence output was a key goal of this fix in C++17).
But may be I am missing something.
More information about the Gcc-bugs
mailing list