Is the comma in a variable list a sequence point?

你。 提交于 2019-11-27 14:20:18

I believe behavior is well-defined because of 8[dcl.decl]/3

Each init-declarator in a declaration is analyzed separately as if it was in a declaration by itself.

Which is even additionally explained in a footnote as

A declaration with several declarators is usually equivalent to the corresponding sequence of declarations each with a single declarator. That is

T D1, D2, ... Dn;

is usually equvalent to

T D1; T D2; ... T Dn;

As you suspect there is a sequence point after each initializer expression, because they're full expressions (1.9/16, 1.9/12).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!