Hi,
In general more trailing commas would be nice and useful.

The motivation you’ve shared, though, isn’t sufficient.

This would allow formatters like clang-format to spread arguments across
newlines.

Clang-format can already do this, with or without trailing commas.

> It can also be useful for parsing partially written function calls,
allowing tools like clangd to provide information about the
function.

Tools like clangd are free to do whatever they want to handle partially valid grammar fragments, with or without language support.

Cheers,
Jeremy


On Sun, Aug 17, 2025 at 10:40 Ungureanu Radu Andrei via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
Hello, I propose allowing trailing commas in function calls:

        int add(int a, int b);
        // Both would be valid calls of the function above:
        add(1,2);
        add(1,2,);

This would allow formatters like clang-format to spread arguments across
newlines.  For example, the code above could be formatted like this:

        int add(int a, int b);
        add(1,2);
        add(
                1,
                2,
        );

This behavior is similar to using a brace-enclosed initializer list.

It can also be useful for parsing partially written function calls,
allowing tools like clangd to provide information about the
function.  I personally found that lacking this feature adds friction
when working on code.

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals