diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index ae39946cc3..d8ef892cb7 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -499,7 +499,7 @@ public: // determine internal storage at compile time template const T &get() const - { return *static_cast(storage()); } + { return *static_cast(CanUseInternalSpace ? &data.data : data.shared->data()); } template void set(const T &t) { *static_cast(CanUseInternalSpace ? &data.data : data.shared->data()) = t; }