# 微软的 C++ 编译器将自增自减炖成了一锅汤

《由一个自增引发的问题》的后续，用实验和文档证明微软挖大坑。

clang和llvm组合应该是这种结果

5.2.6 Increment and decrement [expr.post.incr]

The value of a postﬁx ++ expression is the value of its operand. [ Note: the value obtained is a copy of the original value — end note ] The operand shall be a modiﬁable lvalue. The type of the operand shall be an arithmetic type or a pointer to a complete object type. The value of the operand object is modiﬁed by adding 1 to it, unless the object is of type bool, in which case it is set to true. [ Note: this use is deprecated, see Annex D. — end note ] The value computation of the ++ expression is sequenced before the modiﬁcation of the operand object. With respect to an indeterminately-sequenced function call, the operation of postﬁx ++ is a single evaluation. [ Note: Therefore, a function call shall not intervene between the lvalue-to-rvalue conversion and the side effect associated with any single postﬁx ++ operator. — end note ] The result is a prvalue. The type of the result is the cv-unqualiﬁed version of the type of the operand. See also 5.7 and 5.17.

The operand of postﬁx — is decremented analogously to the postﬁx ++ operator, except that the operand shall not be of type bool. [ Note: For preﬁx increment and decrement, see 5.3.2. — end note ]

5.3.2 Increment and decrement [expr.pre.incr]

The operand of preﬁx ++ is modiﬁed by adding 1, or set to true if it is bool (this use is deprecated). The operand shall be a modiﬁable lvalue. The type of the operand shall be an arithmetic type or a pointer to a completely-deﬁned object type. The result is the updated operand; it is an lvalue, and it is a bit-ﬁeld if the operand is a bit-ﬁeld. If x is not of type bool, the expression ++x is equivalent to x+=1 [ Note: See the discussions of addition (5.7) and assignment operators (5.17) for information on conversions. — end note ]

The operand of preﬁx — is modiﬁed by subtracting 1. The operand shall not be of type bool. The requirements on the operand of preﬁx — and the properties of its result are otherwise the same as those of preﬁx ++. [ Note: For postﬁx increment and decrement, see 5.2.6. — end note ]

• 一堆的脚本加载失败
• 由此带来的不可上传附件和区域空缺

• MSDN 上的 C++ 版块充斥着语言应用的帖子，不是提交错误的地方。
• 这位老兄（年份很早了）想给微软提交一个崩溃报告，但是石沉大海。

• 这位老兄实在是幸运，在 Microsoft Connect 提交的编译器错误最终被修复了。
• 这位老兄的运气就很差，提交了一串bug都没有得到好的反馈，一位善良的客服陪着磨嘴皮子。