diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp index c92ed5b7916a03..2a4b3faee9685c 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/ctor.pass.cpp @@ -10,9 +10,6 @@ // UNSUPPORTED: libcpp-has-no-localization // UNSUPPORTED: libcpp-has-no-incomplete-format -// TODO(mordante): Investigate these localization/format failures since updating the Docker image in CI -// UNSUPPORTED: stdlib=libc++ - // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 @@ -50,9 +47,11 @@ void test() { !std::is_move_assignable_v>); std::basic_string string = MAKE_STRING(CharT, "string"); - std::basic_format_args args = - std::make_format_args>( - true, CharT('a'), 42, string); + // The type of the object is an exposition only type. The temporary is needed + // to extend the lifetype of the object since args stores a pointer to the + // data in this object. + auto format_arg_store = std::make_format_args>(true, CharT('a'), 42, string); + std::basic_format_args args = format_arg_store; { std::basic_string output; diff --git a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp index 224c332ca743b0..89f3a36d011f70 100644 --- a/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp +++ b/libcxx/test/std/utilities/format/format.formatter/format.context/format.context/locale.pass.cpp @@ -10,9 +10,6 @@ // UNSUPPORTED: libcpp-has-no-localization // UNSUPPORTED: libcpp-has-no-incomplete-format -// TODO(mordante): Investigate these localization/format failures since updating the Docker image in CI -// UNSUPPORTED: stdlib=libc++ - // REQUIRES: locale.en_US.UTF-8 // REQUIRES: locale.fr_FR.UTF-8 @@ -34,9 +31,11 @@ void test() { std::locale en_US{LOCALE_en_US_UTF_8}; std::locale fr_FR{LOCALE_fr_FR_UTF_8}; std::basic_string string = MAKE_STRING(CharT, "string"); - std::basic_format_args args = - std::make_format_args>( - true, CharT('a'), 42, string); + // The type of the object is an exposition only type. The temporary is needed + // to extend the lifetype of the object since args stores a pointer to the + // data in this object. + auto format_arg_store = std::make_format_args>(true, CharT('a'), 42, string); + std::basic_format_args args = format_arg_store; { std::basic_string output;