diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp @@ -39,8 +39,12 @@ context.check_arg_id(0); assert(false); } catch (const std::format_error& e) { +#ifdef _LIBCPP_VERSION assert(strcmp(e.what(), "Using manual argument numbering in automatic " "argument numbering mode") == 0); +#else + (void)e; +#endif return; } assert(false); diff --git a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp --- a/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp @@ -39,8 +39,12 @@ context.next_arg_id(); assert(false); } catch (const std::format_error& e) { +#ifdef _LIBCPP_VERSION assert(strcmp(e.what(), "Using automatic argument numbering in manual " "argument numbering mode") == 0); +#else + (void)e; +#endif return; } assert(false);