You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (int x : { 1, }) { } // OKtemplate for (int x : { 1, }) { } // syntax error
Unlike any other brace-enclosed list, an expression-list in an expansion-init-list does not permit the use of trailing commas. This is almost certainly a cplusplus/papers#156 oversight given obvious inconsistencies and that the paper does not discuss this as a design choice.
Furthermore, existing implementations of expansion statements do not implement the standard behavior; see https://godbolt.org/z/czYqPG3r6.