Fix using WX_DECLARE_OBJARRAY() with pointer types

While this doesn't make, and never made, any sense (pointers should be
stored in a plain, non-object array), we still should continue to
support it for compatibility.

Fix the problem introduced by 97684a9267
by writing "T const&" instead of "const T&" as the latter didn't have
the same meaning when the macro parameter "T" expanded into "U*" as
"const" applied to "U", making this type incompatible with the actual
one.

Also extend the unit test to check for this.
This commit is contained in:
Vadim Zeitlin
2018-07-15 14:41:58 +02:00
parent b227875f98
commit 02ffdd16f6
2 changed files with 21 additions and 1 deletions

View File

@@ -652,7 +652,7 @@ private:
classdecl wxObjectArrayTraitsFor##name \
{ \
public: \
static T* Clone(const T& item); \
static T* Clone(T const& item); \
static void Free(T* p); \
}; \
typedef wxBaseObjectArray<T, wxObjectArrayTraitsFor##name> \