[PATCH] D142606: Lazyly initialize uncommon toolchain detector

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 02:46:20 PST 2023


serge-sans-paille added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/LazyDetector.h:26
+
+  mutable std::optional<T> Detector;
+
----------------
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)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142606/new/

https://reviews.llvm.org/D142606



More information about the cfe-commits mailing list