Skip to content

re2: pass Mutex by pointer in MutexLock usage (fixes #628) - #657

Closed
jdymitarai wants to merge 1 commit into
google:mainfrom
jdymitarai:fix-msvc-mutexlock-c2665
Closed

re2: pass Mutex by pointer in MutexLock usage (fixes #628)#657
jdymitarai wants to merge 1 commit into
google:mainfrom
jdymitarai:fix-msvc-mutexlock-c2665

Conversation

@jdymitarai

Copy link
Copy Markdown

Revert commit 972a15ce9aa71e98fec1fc4a10e8eac9fa3bcf24 ("re2: remove unnecessary & in MutexLock usage").

vcpkg and other package managers currently ship Abseil LTS (such as 20250127), which only provides the pointer-based constructor explicit MutexLock(Mutex* mu). Passing Mutex by reference causes MSVC compilation failure with error C2665: 'absl::...::MutexLock::MutexLock': no overloaded function could convert all the argument types when building with CMake/vcpkg on Windows.

Passing by pointer is also consistent with re2/regexp.cc.

Fixes #628.

Revert commit 972a15ce9aa71e98fec1fc4a10e8eac9fa3bcf24 ("re2: remove unnecessary & in MutexLock usage").
vcpkg and other packaging systems use Abseil LTS (such as 20250127), which only provides the pointer-based MutexLock(Mutex*) constructor. Passing Mutex by reference causes MSVC compilation failure with error C2665.

Passing by pointer is also consistent with re2/regexp.cc.

Fixes google#628.
@jdymitarai

Copy link
Copy Markdown
Author

Closing this PR to avoid review overhead on the team. The context remains in the thread for future reference if helpful. Thanks for your time.

@jdymitarai jdymitarai closed this Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant