serge-sans-paille added inline comments.
================ Comment at: clang/lib/Driver/ToolChains/LazyDetector.h:26 + + mutable std::optional<T> Detector; + ---------------- zero9178 wrote: > serge-sans-paille wrote: > > zero9178 wrote: > > > Any reason this is `mutable`? I don't see it being used a non-const way > > > in a const method > > yeah, `T const *operator->() const` updates the optional by actually > > creating the value. (`std::optional::empalce` is not const) > Your `T const *operator->() const` method does not do so, `T *operator->()` > does, which is non-const and hence can call `emplace` without issues. > So as far as C++ goes it is not required. gotcha :-) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142606/new/ https://reviews.llvm.org/D142606 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits