Talk:cpp/language/statements
来自cppreference.com
< Talk:cpp
[编辑] 复合语句后面是不是可以加‘;’?
复合语句后面好像可以加';',但是好像没有语法规则提到这一点
解:语法规则中复合语句后面没有‘;’,但单独的一个';'是一条空语句,将它接到复合语句后面,让人误以为是一条语句。
[编辑] 声明语句应该把后面的‘;’去掉
块声明 ;
|
(1) | ||||||||
这里的';'应该是多余的
在ISO/IEC 14882:2011的P113 有
Note: A declaration is a statement (6.7)
在P137有
A declaration statement introduces one or more new identifiers into a block; it has the form declaration-statement: block-declaration
声明本身包含了‘;’