Report error on duplicate named arg names (#4367)

This commit is contained in:
Dean Glazeski
2025-03-02 08:47:03 -07:00
committed by GitHub
parent b776cf66fc
commit 864bdf9638
2 changed files with 18 additions and 0 deletions

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) {