[libcxx-commits] [libcxx] [libc++][NFC] Simplify `optional<T>` and `optional<T&>` a bit (PR #203665)

William Tran-Viet via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 13 01:19:25 PDT 2026


smallp-o-p wrote:

> Current changes seemingly make `optional<T&>` have a wrong indirect base class for certain builds:
> 
>     * generic-no-experimental
> 
>     * clang-cl-debug, false, clang-cl, clang-cl
> 
>     * clang-cl-dll, false, clang-cl, clang-cl
> 
>     * clang-cl-no-vcruntime, false, clang-cl, clang-cl
> 
> 
> We need to investigate what's going wrong.

I think it's because `__optional_iterator_base<_Tp&>` is only experimental, and it would default to the empty `__optional_iterator_base<_Tp>` which still inherits from the other base classes, of which I removed the checks that made it trivial.

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


More information about the libcxx-commits mailing list