Go to file
Marc Mutz f829ab5573 Q_DECL_NOTHROW: stronger and more widely available version of Q_DECL_NOEXCEPT
Commit 1adca807 defined Q_DECL_NOEXCEPT to be the same as throw() for the
Microsoft compiler. However, the two are not equivalent:

- C++11 noexcept is defined to call std::terminate() if a noexcept
  function nevertheless encounters an exception.
- MSVC throw() has essentially undefined behaviour in this situation:
  http://msdn.microsoft.com/en-us/library/wfa0edys%28v=vs.100%29
   "Due to code optimizations that might be performed by the C++
    compiler [...] if a function does throw an exception, the program
    may not execute correctly."

So define two macros:

1. Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR always have C++11 behaviour.
   This is expected to be the more efficient implementation if the
   function can actually throw.
2. Q_DECL_NOTHROW means that the function gives the nothrow
   guarantee. It is stronger than noexcept, but not all functions
   that can be marked Q_DECL_NOEXCEPT can be marked Q_DECL_NOTHROW.
   In general Q_DECL_NOTHROW functions need to use a try/catch block
   in order to prevent exceptions from leaving the functions, unless
   you can proove that none of the operations can throw.

For the caller, both macros are equivalent: it can be relied on that
no exception leaves the function.

Change-Id: I32f822a82e06a31cb71d38db438387aee5ec3334
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-08-07 21:11:55 +02:00
bin Skip doc subfolders when checking includes. 2012-08-01 15:37:46 +02:00
config.tests Fix Mac OS X architecture detection for non-default Xcode setup. 2012-07-21 00:53:40 +02:00
dist Only emit the clicked() signal from views if the left button is used. 2012-08-07 16:40:07 +02:00
doc change \img to \image in docs 2012-08-01 15:37:46 +02:00
examples fix class and file names in the d-bus examples 2012-08-07 18:55:43 +02:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs add support for PKGCONFIG_PRIVATE 2012-08-07 16:40:07 +02:00
qmake qmake vcxproj generator: map TARGET_EXT to $(TargetExt) 2012-08-07 18:55:43 +02:00
src Q_DECL_NOTHROW: stronger and more widely available version of Q_DECL_NOEXCEPT 2012-08-07 21:11:55 +02:00
tests Only emit the clicked() signal from views if the left button is used. 2012-08-07 16:40:07 +02:00
tools Add possibility to add OpenSSL, DBUS, MySQL path under Windows 2012-08-07 18:55:43 +02:00
util QUnicodeTables: some internal API renamings 2012-06-22 09:47:59 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add the CMake directory created during unit testing to .gitignore. 2012-07-23 07:06:23 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Fix builds with sysroot: a space is necessary before ] in scripts 2012-08-06 16:04:17 +02:00
configure.bat Remove Q_BYTE_ORDER and -*-endian arguments from configures 2012-03-02 14:48:00 +01:00
header.BSD Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.FDL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL-ONLY Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
INSTALL Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL Add the LICENSE.GPL file to the module referenced from license headers 2012-05-20 22:41:08 +02:00
LICENSE.LGPL Update contact information in license headers. 2012-01-23 04:04:33 +01:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Install right version of tools when x-compiling. 2012-07-17 12:52:48 +02:00
sync.profile Revert "Move QWindowSystemInterface out of qpa." 2012-08-03 00:38:09 +02:00