[libcxx-commits] [libcxx] [libc++][format] Don't treat a closing '}' as part of format-spec (PR #81305)

Po-yao Chang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 11 09:26:36 PST 2024


================
@@ -83,13 +84,16 @@ class _LIBCPP_TEMPLATE_VIS basic_format_parse_context {
       std::__throw_format_error("Argument index outside the valid range");
   }
 
+  _LIBCPP_HIDE_FROM_ABI constexpr bool& __should_parse() { return __parse_; }
+
 private:
   iterator __begin_;
   iterator __end_;
   enum _Indexing { __unknown, __manual, __automatic };
   _Indexing __indexing_;
   size_t __next_arg_id_;
   size_t __num_args_;
+  bool __parse_;
----------------
poyaoc97 wrote:

Thanks for the heads up. I was thinking very hard about this and trying to squeeze this information into the most significant bit of `__num_args_`. But I have since realized this is barking up the wrong tree.

https://github.com/llvm/llvm-project/pull/81305


More information about the libcxx-commits mailing list