Drop the empty exception declaration from CheckError
The function is defined as follows:
namespace _com_util {
inline void CheckError(HRESULT hr) throw() {
if(FAILED(hr)) { _com_issue_error(hr); }
}
}
but _com_issue_error is defined as:
inline void _com_issue_error(HRESULT hr) {
#if __EXCEPTIONS
throw _com_error(hr);
#else
/* This is designed to use exceptions. If exceptions are disabled, there is not much we can do here. */
__debugbreak();
#endif
}
so actually calling it with a failed HRESULT crashes the program. I
think the empty exception specification should simply be dropped.
See https://bugs.debian.org/816427
Reported-by: Sam Morris <sam@robots.org.uk>
Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Liu Hao <lh_mouse@126.com>
diff --git a/mingw-w64-headers/include/comutil.h b/mingw-w64-headers/include/comutil.h
index f6d7adc..e090067 100644
--- a/mingw-w64-headers/include/comutil.h
+++ b/mingw-w64-headers/include/comutil.h
@@ -44,7 +44,7 @@
class _variant_t;
namespace _com_util {
- inline void CheckError(HRESULT hr) throw() {
+ inline void CheckError(HRESULT hr) {
if(FAILED(hr)) { _com_issue_error(hr); }
}
}