[all-commits] [llvm/llvm-project] 7ded63: [libc++] Granularize `<optional>` (#206644)

William Tran-Viet via All-commits all-commits at lists.llvm.org
Wed Jul 29 20:12:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ded638ea33b96d9fd628e2a5cbc06df12ede153
      https://github.com/llvm/llvm-project/commit/7ded638ea33b96d9fd628e2a5cbc06df12ede153
  Author: William Tran-Viet <wtranviet at proton.me>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    A libcxx/include/__fwd/optional.h
    A libcxx/include/__optional/common.h
    A libcxx/include/__optional/comparison.h
    A libcxx/include/__optional/hash.h
    A libcxx/include/__optional/make_optional.h
    A libcxx/include/__optional/nullopt_t.h
    A libcxx/include/__optional/optional.h
    A libcxx/include/__optional/optional_ref.h
    A libcxx/include/__optional/swap.h
    M libcxx/include/module.modulemap.in
    M libcxx/include/optional
    M libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.creation/make_ostream_joiner.pass.cpp
    M libcxx/test/std/experimental/iterator/ostream.joiner/ostream.joiner.ops/ostream_joiner.op.assign.pass.cpp
    M libcxx/test/std/utilities/optional/optional.bad_optional_access/derive.pass.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.verify.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.verify.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.verify.cpp

  Log Message:
  -----------
  [libc++] Granularize `<optional>` (#206644)

Certain headers require `optional<T&>`, so it may be beneficial to split
out `optional<T>` and `optional<T&>`. This can allow consumers to only
bring in the `optional` flavour it needs..

- Parcel out the respective pieces into their own header.
- Certain sources rely on transitive includes brought in by
`<optional>`, so they're kept there for now, and only tests have been
fixed.

---------

Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list