Skip to content

Commit 32ca0fd

Browse files
committed
[SourceKit] fix -Wqual-cast warning
When building SourceKit on Linux, this would result in a number of -Wqual-cast warnings due to the `const` being dropped. Add an explicit cast. NFC.
1 parent dfa4b77 commit 32ca0fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/SourceKit/include/SourceKit/Support/ThreadSafeRefCntPtr.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ class ThreadSafeRefCntPtr : ThreadSafeRefCntPtrImpl {
120120
}
121121

122122
operator llvm::IntrusiveRefCntPtr<T>() const {
123-
llvm::sys::ScopedLock L(*getMutex((void*)this));
123+
llvm::sys::ScopedLock L(*getMutex(
124+
reinterpret_cast<void *>(const_cast<ThreadSafeRefCntPtr *>(this))));
124125
llvm::IntrusiveRefCntPtr<T> Ref(Obj.load());
125126
return Ref;
126127
}

0 commit comments

Comments
 (0)