Created on 2006-03-20.00:00:00 last changed 179 months ago
[Voted into the WP at the March, 2009 meeting.]
Proposed resolution (October, 2006):
Add the indicated lines to the grammar definitions in 9.1 [dcl.pre] paragraph 1:
declaration:
...
namespace-definition
empty-declaration
...
static_assert-declaration:
static_assert ( constant-expression , string-literal ) ;
empty-declaration:
;
Add the following as a new paragraph after 9.1 [dcl.pre] paragraph 4:
An empty-declaration has no effect.
The grammar in 9.1 [dcl.pre] paragraph 1 says that a declaration-seq is either declaration or declaration-seq declaration. Some declarations end with semicolons and others (e.g. function definitions and namespace declarations) don't. This means that users who put a semicolon after every declaration are technically writing ill-formed code. The trouble is that in this respect the standard is out of sync with reality. It's convenient to allow semicolons after every declaration, and there's no implementation difficulty in doing so. All existing compilers accept this, except in extra-pedantic mode. When all implementations disagree with the standard, it's time for the standard to change.
Suggested resolution:
In the grammar in 9.1 [dcl.pre] paragraph 11, change the second line in the definition of declaration-seq to
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-03-29 00:00:00 | admin | set | status: wp -> cd2 |
2009-08-03 00:00:00 | admin | set | status: dr -> wp |
2009-03-23 00:00:00 | admin | set | messages: + msg2022 |
2009-03-23 00:00:00 | admin | set | status: ready -> dr |
2008-10-05 00:00:00 | admin | set | status: review -> ready |
2006-11-05 00:00:00 | admin | set | messages: + msg1405 |
2006-11-05 00:00:00 | admin | set | status: open -> review |
2006-03-20 00:00:00 | admin | create |