Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Visual Studio 2022: protobuf\src\google\protobuf\arena.cc(457,51): error C2127: 'thread_cache_': illegal initialization of 'constinit' entity with a non-constant expression #11672 #11674

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/google/protobuf/arena.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ ThreadSafeArena::ThreadCache& ThreadSafeArena::thread_cache() {
return thread_cache;
}
#else
ABSL_CONST_INIT PROTOBUF_THREAD_LOCAL
mkruskal-google marked this conversation as resolved.
Show resolved Hide resolved
PROTOBUF_THREAD_LOCAL
ThreadSafeArena::ThreadCache ThreadSafeArena::thread_cache_;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/thread_safe_arena.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class PROTOBUF_EXPORT ThreadSafeArena {
// wrap them in static functions.
static ThreadCache& thread_cache();
#else
ABSL_CONST_INIT static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
static PROTOBUF_THREAD_LOCAL ThreadCache thread_cache_;
static ThreadCache& thread_cache() { return thread_cache_; }
#endif

Expand Down