[all-commits] [llvm/llvm-project] 08fe7d: [libc++][format] Don't treat a closing '}' as part...

Po-yao Chang via All-commits all-commits at lists.llvm.org
Thu Feb 15 10:41:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 08fe7df600aeff45917eb865d103d6c431f42285
      https://github.com/llvm/llvm-project/commit/08fe7df600aeff45917eb865d103d6c431f42285
  Author: Po-yao Chang <poyaoc97 at gmail.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M libcxx/include/__format/parser_std_format_spec.h
    M libcxx/test/std/containers/container.adaptors/container.adaptors.format/format.functions.tests.h
    M libcxx/test/std/containers/sequences/vector.bool/vector.bool.fmt/format.functions.tests.h
    M libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/format.functions.tests.h
    M libcxx/test/std/utilities/format/format.range/format.range.fmtmap/format.functions.tests.h
    M libcxx/test/std/utilities/format/format.range/format.range.fmtset/format.functions.tests.h
    M libcxx/test/std/utilities/format/format.range/format.range.fmtstr/format.functions.tests.h
    M libcxx/test/std/utilities/format/format.range/format.range.formatter/format.functions.tests.h
    M libcxx/test/std/utilities/format/format.tuple/format.functions.tests.h

  Log Message:
  -----------
  [libc++][format] Don't treat a closing '}' as part of format-spec (#81305)

This allows:
```
std::println("{}>42", std::thread::id{});
std::println("{}>42", std::span<int>{});
std::println("{}>42", std::pair{42, "Hello"sv});
std::println("{:}>42", std::thread::id{});
std::println("{:}>42", std::span<int>{});
std::println("{:}>42", std::pair{42, "Hello"sv});
```
to compile and run.




More information about the All-commits mailing list