[libcxx-commits] [libcxx] [libc++] Mark lwg4084 as resolved (PR #206224)
Connector Switch via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jun 27 00:00:32 PDT 2026
https://github.com/c8ef created https://github.com/llvm/llvm-project/pull/206224
Closes https://github.com/llvm/llvm-project/issues/118346
>From fc715f8eabfe5ab62f91c0833022f061bdbf641c Mon Sep 17 00:00:00 2001
From: c8ef <c8ef at outlook.com>
Date: Sat, 27 Jun 2026 14:57:15 +0800
Subject: [PATCH] [libc++] Mark lwg4084 as resolved
---
libcxx/docs/Status/Cxx26Issues.csv | 2 +-
.../facet.num.put.members/lwg4084.pass.cpp | 65 +++++++++++++++++++
2 files changed, 66 insertions(+), 1 deletion(-)
create mode 100644 libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/lwg4084.pass.cpp
diff --git a/libcxx/docs/Status/Cxx26Issues.csv b/libcxx/docs/Status/Cxx26Issues.csv
index d4f7a44910e00..9b764f2c32377 100644
--- a/libcxx/docs/Status/Cxx26Issues.csv
+++ b/libcxx/docs/Status/Cxx26Issues.csv
@@ -88,7 +88,7 @@
"`LWG4044 <https://wg21.link/LWG4044>`__","Confusing requirements for ``std::print`` on POSIX platforms","2024-11 (Wrocław)","","","`#118343 <https://github.com/llvm/llvm-project/issues/118343>`__",""
"`LWG4064 <https://wg21.link/LWG4064>`__","Clarify that ``std::launder`` is not needed when using the result of ``std::memcpy``","2024-11 (Wrocław)","","","`#118344 <https://github.com/llvm/llvm-project/issues/118344>`__",""
"`LWG4072 <https://wg21.link/LWG4072>`__","``std::optional`` comparisons: constrain harder","2024-11 (Wrocław)","","","`#118345 <https://github.com/llvm/llvm-project/issues/118345>`__",""
-"`LWG4084 <https://wg21.link/LWG4084>`__","``std::fixed`` ignores ``std::uppercase``","2024-11 (Wrocław)","","","`#118346 <https://github.com/llvm/llvm-project/issues/118346>`__",""
+"`LWG4084 <https://wg21.link/LWG4084>`__","``std::fixed`` ignores ``std::uppercase``","2024-11 (Wrocław)","|Complete|","","`#118346 <https://github.com/llvm/llvm-project/issues/118346>`__",""
"`LWG4085 <https://wg21.link/LWG4085>`__","``ranges::generate_random``'s helper lambda should specify the return type","2024-11 (Wrocław)","","","`#118347 <https://github.com/llvm/llvm-project/issues/118347>`__",""
"`LWG4088 <https://wg21.link/LWG4088>`__","``println`` ignores the locale imbued in ``std::ostream``","2024-11 (Wrocław)","|Complete|","18","`#118348 <https://github.com/llvm/llvm-project/issues/118348>`__",""
"`LWG4112 <https://wg21.link/LWG4112>`__","``has-arrow`` should required ``operator->()`` to be ``const``-qualified","2024-11 (Wrocław)","","","`#118349 <https://github.com/llvm/llvm-project/issues/118349>`__",""
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/lwg4084.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/lwg4084.pass.cpp
new file mode 100644
index 0000000000000..5769c8c14066e
--- /dev/null
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/lwg4084.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class num_put<charT, OutputIterator>
+
+// LWG4084: std::fixed ignores std::uppercase
+
+#include <cassert>
+#include <ios>
+#include <limits>
+#include <locale>
+#include <string>
+
+#include "test_iterators.h"
+
+typedef std::num_put<char, cpp17_output_iterator<char*> > Facet;
+
+class my_facet : public Facet {
+public:
+ explicit my_facet(std::size_t refs = 0) : Facet(refs) {}
+};
+
+template <class T>
+std::string put(T value, std::ios_base& ios) {
+ char str[100];
+ const my_facet f(1);
+ cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), ios, '*', value);
+ return std::string(str, base(iter));
+}
+
+bool is_lowercase_infinity(const std::string& str) { return str == "inf" || str == "infinity"; }
+
+bool is_uppercase_infinity(const std::string& str) { return str == "INF" || str == "INFINITY"; }
+
+template <class T>
+void test() {
+ {
+ std::ios ios(0);
+ std::fixed(ios);
+ std::nouppercase(ios);
+
+ assert(is_lowercase_infinity(put(std::numeric_limits<T>::infinity(), ios)));
+ }
+ {
+ std::ios ios(0);
+ std::fixed(ios);
+ std::uppercase(ios);
+
+ assert(is_uppercase_infinity(put(std::numeric_limits<T>::infinity(), ios)));
+ }
+}
+
+int main(int, char**) {
+ test<double>();
+ test<long double>();
+
+ return 0;
+}
More information about the libcxx-commits
mailing list