From 7c2e0edc7eefff1d6b89880eb545b2dfdb2a2e6a Mon Sep 17 00:00:00 2001 From: jules Date: Sat, 23 Nov 2019 08:51:30 +0000 Subject: [PATCH] Added a deleted void* constructor to var, to prevent people accidentally giving it a raw pointer and having it cast to bool --- modules/juce_core/containers/juce_Variant.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/juce_core/containers/juce_Variant.h b/modules/juce_core/containers/juce_Variant.h index e115d770bb..2596576c2b 100644 --- a/modules/juce_core/containers/juce_Variant.h +++ b/modules/juce_core/containers/juce_Variant.h @@ -302,7 +302,7 @@ private: int64 int64Value; bool boolValue; double doubleValue; - char stringValue [sizeof (String)]; + char stringValue[sizeof (String)]; ReferenceCountedObject* objectValue; MemoryBlock* binaryValue; NativeFunction* methodValue; @@ -319,6 +319,8 @@ private: // This is needed to prevent the wrong constructor/operator being called var (const ReferenceCountedObject*) = delete; var& operator= (const ReferenceCountedObject*) = delete; + var (const void*) = delete; + var& operator= (const void*) = delete; }; /** Compares the values of two var objects, using the var::equals() comparison. */