Title
Trailing comma in an expansion-init-list
Status
ready
Section
8.7 [stmt.expand]
Submitter
Jan Schultke

Created on 2025-08-24.00:00:00 last changed 1 month ago

Messages

Date: 2025-11-07.02:25:59

Proposed resolution (approved by CWG 2025-11-06):

Change in 8.7 [stmt.expand] paragraph 1 as follows:

  expansion-init-list :
       { expression-listopt }
       { expression-list ,opt }
       { }
Date: 2025-08-24.00:00:00

(From submission #754.)

Brace-enclosed lists generally allow trailing commas. But an expansion-init-list does not; consider:

           for (int x : { 1, }) { }   // OK
  template for (int x : { 1, }) { }   // syntax error
History
Date User Action Args
2025-11-07 02:25:59adminsetstatus: tentatively ready -> ready
2025-09-12 22:42:26adminsetmessages: + msg8093
2025-08-24 00:00:00admincreate