This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78734] New: [C++17] P0145R3: function arguments are indeterminately sequenced
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Dec 2016 09:44:19 +0000
- Subject: [Bug c++/78734] New: [C++17] P0145R3: function arguments are indeterminately sequenced
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78734
Bug ID: 78734
Summary: [C++17] P0145R3: function arguments are
indeterminately sequenced
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
CC: jason at gcc dot gnu.org
Target Milestone: ---
P0145R3 says that function arguments are indeterminately sequenced.
Consider the following example from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0431r0.htm:
markus@x4 /tmp % cat order.cpp
#include <stdio.h>
void foo(int a, int b, int c) { printf("%d %d %d\n", a, b, c); }
int main() {
int i = 0;
foo(++i, ++i, ++i);
}
markus@x4 /tmp % g++ -std=c++1z order.cpp
markus@x4 /tmp % ./a.out
3 3 3
This is wrong. It should be a permutation of "1 2 3".