[libcxx-commits] [PATCH] D103444: [libcxx] Don't use an undefined '+' in unsigned/octal/hexal print formats

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 4 02:09:33 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb0cc7b53a53f: [libcxx] Don't use an undefined '+' in unsigned/octal/hexal print formats (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D103444?vs=348921&id=349793#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103444/new/

https://reviews.llvm.org/D103444

Files:
  libcxx/src/locale.cpp


Index: libcxx/src/locale.cpp
===================================================================
--- libcxx/src/locale.cpp
+++ libcxx/src/locale.cpp
@@ -4597,7 +4597,10 @@
 __num_put_base::__format_int(char* __fmtp, const char* __len, bool __signd,
                              ios_base::fmtflags __flags)
 {
-    if (__flags & ios_base::showpos)
+    if ((__flags & ios_base::showpos) &&
+        (__flags & ios_base::basefield) != ios_base::oct &&
+        (__flags & ios_base::basefield) != ios_base::hex &&
+	__signd)
         *__fmtp++ = '+';
     if (__flags & ios_base::showbase)
         *__fmtp++ = '#';


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103444.349793.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210604/06446199/attachment.bin>


More information about the libcxx-commits mailing list