Edit: This answer is incorrect for the updated question, it applies to the question as originally stated.
(i++)++
shouldn't work with either gcc or g++, whether or not they are parsing the file as C or C++ in both languages postfix increment requires an lvalue as an operand and the result is an rvalue.
(Note that rvalue is only used formally in C++. In C the results of expressions are either explicitly lvalues or they're just not lvalues. The term rvalue isn't used in the normative text of the C standard at all.)
Simplisticly, an lvalue is an expression that refers to an object, i.e. conceptually a region of storage somewhere. A modifiable lvalue is something that it is valid to assign to so can appear on the left hand side of an assignment expression.
An rvalue is just a value, something that you can assign a modifiable lvalue from, but not something that you can assign to. It can only appear on the right side of an assignment expression.
g++
gives me the error: lvalue required as increment operand
.
Prefix increment (and decrement) are slightly different. In C++ the result of a prefix increment is explicitly an lvalue (5.3.2/1 [expr.pre.incr]); in C it is explicitly not an lvalue (6.5.3.1 states that ++E is equivalent to (E+=1); 6.5.16 says that the result of any assignment is not an lvalue).
(++i)++
is, therefore, semantically correct only in C++, however it has undefined behaviour because you are storing a value to an object twice without an intervening sequence point.