Report error on duplicate named arg names (#4367)

This commit is contained in:
Dean Glazeski authored and GitHub committed 2025-03-02 07:47:03 -08:00
1 parent b776cf66fc
commit 864bdf9638
2 files changed
+18

No files matched your search

+2
View File
@@ -599,6 +599,8 @@ TEST(format_test, named_arg) {
EXPECT_THROW_MSG((void)fmt::format(runtime("{a} {}"), fmt::arg("a", 2), 42),
format_error,
"cannot switch from manual to automatic argument indexing");
EXPECT_THROW_MSG((void)fmt::format("{a}", fmt::arg("a", 1),
fmt::arg("a", 10)), format_error, "duplicate named args found");
}
TEST(format_test, auto_arg_index) {