[Lldb-commits] [lldb] 6e6e7a7 - [lldb] Make SBFile::operator bool explicit (#215819)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 13 13:07:18 PDT 2026


Author: Raphael Isemann
Date: 2026-08-13T21:07:13+01:00
New Revision: 6e6e7a7383fcf4291546f559adfb1b220dc3308d

URL: https://github.com/llvm/llvm-project/commit/6e6e7a7383fcf4291546f559adfb1b220dc3308d
DIFF: https://github.com/llvm/llvm-project/commit/6e6e7a7383fcf4291546f559adfb1b220dc3308d.diff

LOG: [lldb] Make SBFile::operator bool explicit (#215819)

Every other SB class in the API declares `explicit operator bool()`.
SBFile was the only one with an implicit conversion, which in general is
not something we want.

Added: 
    

Modified: 
    lldb/include/lldb/API/SBFile.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/API/SBFile.h b/lldb/include/lldb/API/SBFile.h
index 8cf4fe1b405fa..c73a134e34d22 100644
--- a/lldb/include/lldb/API/SBFile.h
+++ b/lldb/include/lldb/API/SBFile.h
@@ -43,7 +43,7 @@ class LLDB_API SBFile {
   bool IsValid() const;
   SBError Close();
 
-  operator bool() const;
+  explicit operator bool() const;
 #ifndef SWIG
   bool operator!() const;
 #endif


        


More information about the lldb-commits mailing list