diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-04-28 11:30:18 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2017-04-28 09:49:18 +0000 |
commit | 73ba1c3442dc7bb14a71183a98f6a08f9600f4e9 (patch) | |
tree | ee9f101c227fb4d6926cdd2b0ccdc6155d460429 | |
parent | f8abfa1bb6f46a5a61fb94ecaf7bd07c34133e2b (diff) |
shiboken test/Photon: Properly define noexcept
Defining noexcept as empty leads to a compile
error when including <map> of VS2015/U3.
Introduce a macro PHOTON_NOEXCEPT and also enable
it for VS2015.
Amends change 6c44bbf45124973e8f1a8c35fb28f0537274a794
Task-number: PYSIDE-324
Change-Id: Ie3157f6e62c8e3fe443842513983582edf491d18
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | tests/libsample/photon.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/libsample/photon.h b/tests/libsample/photon.h index e3baa12f9..d8b1be423 100644 --- a/tests/libsample/photon.h +++ b/tests/libsample/photon.h @@ -108,21 +108,23 @@ LIBSAMPLE_API int countValueDuplicators(const std::list<TemplateBase<DuplicatorT // // NOTE: For reasons that should be fairly obvious, this test unfortunately can // only be "run" when building in C++11 mode. -#if __cplusplus < 201103L -#define noexcept +#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900) +# define PHOTON_NOEXCEPT noexcept +#else +# define PHOTON_NOEXCEPT #endif class Pointer { public: - Pointer() noexcept : px(0) {} + Pointer() PHOTON_NOEXCEPT : px(0) {} Pointer(int* p) : px(p) {} - void reset() noexcept { Pointer().swap(*this); } + void reset() PHOTON_NOEXCEPT { Pointer().swap(*this); } - int* get() const noexcept { return px; } + int* get() const PHOTON_NOEXCEPT { return px; } int& operator*() const { return *px; } - void swap(Pointer& rhs) noexcept + void swap(Pointer& rhs) PHOTON_NOEXCEPT { int* tmp = px; px = rhs.px; |