[Lldb-commits] [lldb] Fix MSVC build issues (PR #84362)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 7 13:11:01 PST 2024


================
@@ -168,8 +168,8 @@ class ConstString {
   // Implicitly convert \class ConstString instances to \class StringRef.
   operator llvm::StringRef() const { return GetStringRef(); }
 
-  // Implicitly convert \class ConstString instances to \class std::string_view.
-  operator std::string_view() const {
+  // Explicitly convert \class ConstString instances to \class std::string_view.
+  explicit operator std::string_view() const {
----------------
bulbazord wrote:

I think that would be nice to do. FWIW, I tried making the StringRef conversion operator explicit a few months ago and found that it was a pretty large change. We use the implicitness of the conversion in a lot of places.

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


More information about the lldb-commits mailing list