From 390b16aea85e64bc33ce91e37898f59ad8a994c7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 8 Jan 2015 15:08:22 +0100 Subject: QtCore: mark some operations nothrow This shotgun-surgery approach is motivated by trying to get a clean(er) build for -Wnoexcept on GCC, so it is expected that for any class touched here, there will be more operations that can be marked nothrow. But they don't show up in conditional noexcept clauses, yet, so they are deferred to some later commit. Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 2 +- src/corelib/kernel/qvariant.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index ca3d92bad1..555b5e0263 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -318,7 +318,7 @@ QCoreApplication *QCoreApplication::self = 0; uint QCoreApplicationPrivate::attribs = (1 << Qt::AA_SynthesizeMouseForUnhandledTouchEvents); struct QCoreApplicationData { - QCoreApplicationData() { + QCoreApplicationData() Q_DECL_NOTHROW { #ifndef QT_NO_LIBRARY app_libpaths = 0; #endif diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 7dce813bb5..7bee756fa5 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -253,13 +253,13 @@ class Q_CORE_EXPORT QVariant QVariant& operator=(const QVariant &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QVariant(QVariant &&other) : d(other.d) + inline QVariant(QVariant &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Private(); } - inline QVariant &operator=(QVariant &&other) + inline QVariant &operator=(QVariant &&other) Q_DECL_NOTHROW { qSwap(d, other.d); return *this; } #endif - inline void swap(QVariant &other) { qSwap(d, other.d); } + inline void swap(QVariant &other) Q_DECL_NOTHROW { qSwap(d, other.d); } Type type() const; int userType() const; @@ -360,15 +360,15 @@ class Q_CORE_EXPORT QVariant }; struct Private { - inline Private(): type(Invalid), is_shared(false), is_null(true) + inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true) { data.ptr = 0; } // Internal constructor for initialized variants. - explicit inline Private(uint variantType) + explicit inline Private(uint variantType) Q_DECL_NOTHROW : type(variantType), is_shared(false), is_null(false) {} - inline Private(const Private &other) + inline Private(const Private &other) Q_DECL_NOTHROW : data(other.data), type(other.type), is_shared(other.is_shared), is_null(other.is_null) {} -- cgit v1.2.3