From a8b33bf08ed582a241071ff7fa876dec1911ed7a Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Sat, 16 Sep 2017 22:36:08 +0200 Subject: [PATCH] Make the private.h header compatible with Clang. The include/wx/msw/private.h header contains a violation of the C++ standards that MSVC tolerates but Clang/LLVM does not. WinBase.h contains the definition: #define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1) Which wxWidgets uses in: template The (effective) reinterpret_cast-ing of INVALID_HANDLE_VALUE in WinBase.h means that the define isn't actually usable as a constant expression for the template parameter. Clang has indicated they have no intention of adding an MSVC compatibility workaround for this problem. See LLVM bug 12116: https://bugs.llvm.org/show_bug.cgi?id=12116 Given this, rework the wxWidgets header to remove the default template parameter value (it is not used anywhere). With this change, it's possible to compile wxWidgets applications using Clang/LLVM (5.0) under MSVC. --- include/wx/msw/private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 6e1c65941b..f168414805 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -153,7 +153,7 @@ extern LONG APIENTRY #endif // close the handle in the class dtor -template +template class AutoHANDLE { public: