From a0e5592007714f82a1ee130b75e3a8d9c39944d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Nov 2012 12:49:03 +0000 Subject: [PATCH] Revert all wxNOEXCEPT-related changes. This reverts r72978, 72984, 72989 and 72992. Do not use wxNOEXCEPT for wxTextCtrl dtor as this breaks compilation of any user-defined classes inheriting from it unless they use wxNOEXCEPT as well and the benefits (fixing a harmless warning for the niche ICC compiler) are just not worth the compatibility breakage. See #14826. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 - include/wx/cocoa/textctrl.h | 2 +- include/wx/defs.h | 11 ----------- include/wx/gtk/textctrl.h | 2 +- include/wx/gtk1/textctrl.h | 2 +- include/wx/msw/textctrl.h | 2 +- include/wx/os2/textctrl.h | 2 +- include/wx/osx/textctrl.h | 2 +- include/wx/stdstream.h | 8 ++++---- include/wx/textctrl.h | 2 +- include/wx/univ/textctrl.h | 2 +- include/wx/x11/textctrl.h | 2 +- interface/wx/defs.h | 16 ---------------- src/common/combocmn.cpp | 2 +- src/generic/spinctlg.cpp | 2 +- src/generic/treectlg.cpp | 2 -- src/gtk/textctrl.cpp | 2 +- src/gtk1/textctrl.cpp | 2 +- src/msw/textctrl.cpp | 2 +- src/univ/textctrl.cpp | 2 +- 20 files changed, 19 insertions(+), 49 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index f1dbd24a42..ed1b5ad72b 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -550,7 +550,6 @@ All: - Add wxFile::ReadAll() for consistency with wxFFile. - Add wxDateTime::DiffAsDateSpan() and wxDateSpan::GetTotalMonths() (jonasr). - Add wxVector::assign() (Jonas Rydberg). -- Add wxNOEXCEPT (Marian VooDooMan Meravy). - Added Nepali translation (Him Prasad Gautam). All (GUI): diff --git a/include/wx/cocoa/textctrl.h b/include/wx/cocoa/textctrl.h index 50ff930220..64e4f32a6c 100644 --- a/include/wx/cocoa/textctrl.h +++ b/include/wx/cocoa/textctrl.h @@ -43,7 +43,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr); - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); // ------------------------------------------------------------------------ // Cocoa specifics diff --git a/include/wx/defs.h b/include/wx/defs.h index a3a08d026f..a96a6e91f4 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -3335,17 +3335,6 @@ typedef const void* WXWidget; #define DECLARE_NO_ASSIGN_CLASS(classname) \ wxDECLARE_NO_ASSIGN_CLASS(classname); -/* Macro that can be used to indicate that a function doesn't throw. */ -#if defined(__cplusplus) && __cplusplus >= 199711L /* C++98 */ -# if __cplusplus >= 201103L /* >= C++11 */ -# define wxNOEXCEPT noexcept -# else -# define wxNOEXCEPT throw() -# endif -#else -# define wxNOEXCEPT -#endif - /* --------------------------------------------------------------------------- */ /* If a manifest is being automatically generated, add common controls 6 to it */ /* --------------------------------------------------------------------------- */ diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index f0ba8549b2..60e07203a7 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -30,7 +30,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, diff --git a/include/wx/gtk1/textctrl.h b/include/wx/gtk1/textctrl.h index bcff37f3ff..c594bc46b2 100644 --- a/include/wx/gtk1/textctrl.h +++ b/include/wx/gtk1/textctrl.h @@ -28,7 +28,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index f80eef03b2..c56bcae45a 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -31,7 +31,7 @@ public: Create(parent, id, value, pos, size, style, validator, name); } - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, const wxString& value = wxEmptyString, diff --git a/include/wx/os2/textctrl.h b/include/wx/os2/textctrl.h index 6790171991..59a7570ad4 100644 --- a/include/wx/os2/textctrl.h +++ b/include/wx/os2/textctrl.h @@ -30,7 +30,7 @@ public: { Create(pParent, vId, rsValue, rPos, rSize, lStyle, rValidator, rsName); } - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create( wxWindow* pParent ,wxWindowID vId diff --git a/include/wx/osx/textctrl.h b/include/wx/osx/textctrl.h index 94d714f8dc..c983eee964 100644 --- a/include/wx/osx/textctrl.h +++ b/include/wx/osx/textctrl.h @@ -47,7 +47,7 @@ public: Create(parent, id, value, pos, size, style, validator, name); } - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, diff --git a/include/wx/stdstream.h b/include/wx/stdstream.h index cc65cc34f1..27d48d5c8b 100644 --- a/include/wx/stdstream.h +++ b/include/wx/stdstream.h @@ -28,7 +28,7 @@ class WXDLLIMPEXP_BASE wxStdInputStreamBuffer : public std::streambuf { public: wxStdInputStreamBuffer(wxInputStream& stream); - virtual ~wxStdInputStreamBuffer() wxNOEXCEPT { } + virtual ~wxStdInputStreamBuffer() { } protected: virtual std::streambuf *setbuf(char *s, std::streamsize n); @@ -71,7 +71,7 @@ class WXDLLIMPEXP_BASE wxStdInputStream : public std::istream { public: wxStdInputStream(wxInputStream& stream); - virtual ~wxStdInputStream() wxNOEXCEPT { } + virtual ~wxStdInputStream() { } protected: wxStdInputStreamBuffer m_streamBuffer; @@ -85,7 +85,7 @@ class WXDLLIMPEXP_BASE wxStdOutputStreamBuffer : public std::streambuf { public: wxStdOutputStreamBuffer(wxOutputStream& stream); - virtual ~wxStdOutputStreamBuffer() wxNOEXCEPT { } + virtual ~wxStdOutputStreamBuffer() { } protected: virtual std::streambuf *setbuf(char *s, std::streamsize n); @@ -112,7 +112,7 @@ class WXDLLIMPEXP_BASE wxStdOutputStream : public std::ostream { public: wxStdOutputStream(wxOutputStream& stream); - virtual ~wxStdOutputStream() wxNOEXCEPT { } + virtual ~wxStdOutputStream() { } protected: wxStdOutputStreamBuffer m_streamBuffer; diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index dcf0311b74..d4780cc987 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -679,7 +679,7 @@ public: // -------- wxTextCtrlBase() { } - virtual ~wxTextCtrlBase() wxNOEXCEPT { } + virtual ~wxTextCtrlBase() { } // more readable flag testing methods diff --git a/include/wx/univ/textctrl.h b/include/wx/univ/textctrl.h index bf3483b6f1..6646ad91c7 100644 --- a/include/wx/univ/textctrl.h +++ b/include/wx/univ/textctrl.h @@ -99,7 +99,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxTextCtrlNameStr); - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); // implement base class pure virtuals // ---------------------------------- diff --git a/include/wx/x11/textctrl.h b/include/wx/x11/textctrl.h index d2b10f9091..81a7e70662 100644 --- a/include/wx/x11/textctrl.h +++ b/include/wx/x11/textctrl.h @@ -96,7 +96,7 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString &name = wxTextCtrlNameStr); - virtual ~wxTextCtrl() wxNOEXCEPT; + virtual ~wxTextCtrl(); bool Create(wxWindow *parent, wxWindowID id, diff --git a/interface/wx/defs.h b/interface/wx/defs.h index 43b41fb971..0c310f10d2 100644 --- a/interface/wx/defs.h +++ b/interface/wx/defs.h @@ -1725,22 +1725,6 @@ template wxSwap(T& first, T& second); */ void wxVaCopy(va_list argptrDst, va_list argptrSrc); -/** - Macro that can be used to indicate that a function doesn't throw any - exceptions. - - This macro expands to `noexcept` when using C++11 compiler or `throw()` for - older C++ compilers or nothing when used with a C++ compiler too old to - support even this. - - Notice that `noexcept` and `throw()` have different semantics in case an - exception @e is thrown, so this macro should be used only if you don't rely - on the behaviour provided by the latter but not the former. - - @since 2.9.5 - */ -#define wxNOEXCEPT - //@} diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index d8d2915f10..ac476a5add 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -940,7 +940,7 @@ class wxComboCtrlTextCtrl : public wxTextCtrl { public: wxComboCtrlTextCtrl() : wxTextCtrl() { } - virtual ~wxComboCtrlTextCtrl() wxNOEXCEPT { } + virtual ~wxComboCtrlTextCtrl() { } virtual wxWindow *GetMainWindowOfCompositeControl() { diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index f602d8ded5..64d00b43ff 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -77,7 +77,7 @@ public: SetSizeHints(wxDefaultCoord, wxDefaultCoord); } - virtual ~wxSpinCtrlTextGeneric() wxNOEXCEPT + virtual ~wxSpinCtrlTextGeneric() { // MSW sends extra kill focus event on destroy if (m_spin) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 3aa40f9fca..28ac6d781a 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -95,8 +95,6 @@ class WXDLLEXPORT wxTreeTextCtrl: public wxTextCtrl public: wxTreeTextCtrl(wxGenericTreeCtrl *owner, wxGenericTreeItem *item); - virtual ~wxTreeTextCtrl() wxNOEXCEPT {} - void EndEdit( bool discardChanges ); const wxGenericTreeItem* item() const { return m_itemEdited; } diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 0e408c532b..ecb98e6bdc 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -610,7 +610,7 @@ void wxTextCtrl::Init() m_anonymousMarkList = NULL; } -wxTextCtrl::~wxTextCtrl() wxNOEXCEPT +wxTextCtrl::~wxTextCtrl() { if (m_text) GTKDisconnect(m_text); diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 2254d29ede..7ce0d35e3d 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -226,7 +226,7 @@ void wxTextCtrl::Init() m_vScrollbar = NULL; } -wxTextCtrl::~wxTextCtrl() wxNOEXCEPT +wxTextCtrl::~wxTextCtrl() { } diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 9fa201a931..4245b58125 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -229,7 +229,7 @@ void wxTextCtrl::Init() m_isNativeCaretShown = true; } -wxTextCtrl::~wxTextCtrl() wxNOEXCEPT +wxTextCtrl::~wxTextCtrl() { #if wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT if ( m_dropTarget == wxRICHTEXT_DEFAULT_DROPTARGET ) diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 8c3875cc82..041ea21d51 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -764,7 +764,7 @@ bool wxTextCtrl::Create(wxWindow *parent, return true; } -wxTextCtrl::~wxTextCtrl() wxNOEXCEPT +wxTextCtrl::~wxTextCtrl() { delete m_cmdProcessor; -- 2.47.2