From f201634c578ff63e51f120472297afef14d9789b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Nov 2013 18:25:43 +0000 Subject: [PATCH] Add a comment explaining the need for a temporary NULL variable. Explain the changes of r75162 as they risk not being preserved otherwise. Also make this variable static and const because it's really a constant. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/xlocale.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/xlocale.cpp b/src/common/xlocale.cpp index dad7778b0a..26ac4df2a3 100644 --- a/src/common/xlocale.cpp +++ b/src/common/xlocale.cpp @@ -76,7 +76,9 @@ wxXLocale& wxXLocale::GetCLocale() { if ( !gs_cLocale ) { - wxXLocaleCTag* tag = NULL; + // Notice that we need a separate variable because clang 3.1 refuses to + // cast nullptr (which is how NULL is defined in it) to anything. + static wxXLocaleCTag* const tag = NULL; gs_cLocale = new wxXLocale(tag); }