https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
Andrew Pinski changed:
What|Removed |Added
Target Milestone|--- |7.0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
Marek Polacek changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #7 from Marek Polacek ---
Author: mpolacek
Date: Tue Apr 26 11:32:26 2016
New Revision: 235438
URL: https://gcc.gnu.org/viewcvs?rev=235438&root=gcc&view=rev
Log:
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2016-04-25 Mar
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #6 from Marek Polacek ---
You're right. Of course - in C++, ++i and --i are considered lvalues, while
i++ and i-- are not.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #5 from Donald Chai ---
For what it's worth, post-increments behave as I would expect:
$ cat test.c
int main() {
int x = 1;
x++ ?: 0xbeef;
return x;
}
$ gcc-5 -x c test.c; ./a.out; echo $?
2
$ gcc-5 -x c++ test.c; ./a.out
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #4 from Marek Polacek ---
A possible fix seems to be
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4255,6 +4255,12 @@ stabilize_reference (tree ref)
volatiles. */
return stabilize_reference_1 (ref);
+case POSTDECREMENT_EXPR:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
--- Comment #3 from Marek Polacek ---
So build_conditional_expr_1 has
4626 /* As a G++ extension, the second argument to the conditional can be
4627 omitted. (So that `a ? : c' is roughly equivalent to `a ? a :
4628 c'.) If the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
Marek Polacek changed:
What|Removed |Added
Status|NEW |ASSIGNED
CC|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70744
Richard Biener changed:
What|Removed |Added
Keywords||wrong-code
Status|UNCONFIRM