1. Changelog
1.1. Revision 0 - June 17th, 2022
-
Initial release. ✨
2. Introduction & Motivation
[N2900] forgot to update the grammar for compound literals, meaning that while the prose contained within for initialization technically includes compound literals, it is impossible to actually form a compound literal with an empty initializer.
This was seen as a mostly editorial fix, but unfortunately neither N2900 nor any minuted discussion ever actually spoke about this, likely because it was an afterthought to the issues we were resolving concerning the construct. As it stands, no compiler that actually implements empty brace initialization as an extension leaves this out. This was a needless failure on the part of the original author, JeanHeyd Meneide, for just not noticing.
I am sorry.
3. Wording
The following wording is registered against [N2912].
3.1. Modify §6.5.2 paragraph 1’s grammar
postfix-expression:
…
( type-name ) { initializer-list }
( type-name ) { initializer-list , }
- ( type-name ) { }