From 19fded547367dead91c289370ea95ae266b73a29 Mon Sep 17 00:00:00 2001 From: "Zane U. Ji" Date: Fri, 21 Mar 2014 00:10:39 +0800 Subject: [PATCH] Initialized constant objects explicitly (Bug #208) From 8.5.9 of the C++ 2003 standard: If no initializer is specified for an object, and the object is of (possibly cv-qualified) non-POD class type (or array thereof), the object shall be default-initialized; if the object is of const-qualified type, the underlying class type shall have a user-declared default constructor. Otherwise, if no initializer is specified for a nonstatic object, the object and its subobjects, if any, have an indeterminate initial value); if the object or any of its subobjects are of const-qualified type, the program is ill-formed. --- src/wrapxerces.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wrapxerces.cpp b/src/wrapxerces.cpp index dcd8d45..0bd00f1 100644 --- a/src/wrapxerces.cpp +++ b/src/wrapxerces.cpp @@ -169,12 +169,12 @@ const wxMBConv &WrapXerces::getMBConv() return wxConvUTF8; case 2: { - const static wxMBConvUTF16 conv; + const static wxMBConvUTF16 conv = wxMBConvUTF16(); return conv; } case 4: { - const static wxMBConvUTF32 conv; + const static wxMBConvUTF32 conv = wxMBConvUTF32(); return conv; } default: