Silence bogus MSVC warning about variable not used
The compiler is wrong: the variable was used in the previous line. However, the line had no effect for a type T that has a trivial destructor, so the optimizer must have discarded the line and the reference to the variable before the checker for used variables. qsharedpointer_impl.h(247) : warning C4189: 'that' : local variable is initialized but not referenced Change-Id: Ia0aac2f09e9245339951ffff13c8bde02bb46816 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
8972ceea87
commit
84b9d07163
|
|
@ -247,6 +247,7 @@ namespace QtSharedPointer {
|
|||
ExternalRefCountWithContiguousData *that =
|
||||
static_cast<ExternalRefCountWithContiguousData *>(self);
|
||||
that->data.~T();
|
||||
Q_UNUSED(that); // MSVC warns if T has a trivial destructor
|
||||
}
|
||||
static void safetyCheckDeleter(ExternalRefCountData *self)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue