Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions src/coreclr/gc/env/volatile.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,16 @@ class VolatilePtr : public Volatile<P>
{
}

//
// Bring the base class operator= into scope.
//
using Volatile<P>::operator=;

//
// Copy assignment operator.
//
inline VolatilePtr<T,P>& operator=(const VolatilePtr<T,P>& other) {this->Store(other.Load()); return *this;}

//
// Cast to the pointer type
//
Expand Down
13 changes: 13 additions & 0 deletions src/coreclr/inc/volatile.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,19 @@ class VolatilePtr : public Volatile<P>
STATIC_CONTRACT_SUPPORTS_DAC;
}

//
// Bring the base class operator= into scope. Without this, the compiler-generated
// copy assignment operator hides Volatile<P>::operator= and performs a plain store,
// bypassing the memory barriers provided by VolatileStore.
//
using Volatile<P>::operator=;

//
// Copy assignment operator. The using declaration above does not suppress the
// compiler-generated copy assignment, so we must define it explicitly.
//
inline VolatilePtr<T,P>& operator=(const VolatilePtr<T,P>& other) {this->Store(other.Load()); return *this;}

//
// Cast to the pointer type
//
Expand Down
Loading