From 1a626a1db560299f57a3895171766171e0aa1a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 17 Nov 2020 21:15:05 +0100 Subject: [PATCH] GL: Context move constructor should be marked noexcept. --- doc/changelog.dox | 2 ++ src/Magnum/GL/Context.cpp | 2 +- src/Magnum/GL/Context.h | 2 +- src/Magnum/GL/Test/ContextTest.cpp | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 215220e33..0220dfac8 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -188,6 +188,8 @@ See also: @subsection changelog-latest-bugfixes Bug fixes +- @ref GL::Context move constructor was not marked @cpp noexcept @ce by + accident - @ref Platform::EmscriptenApplication randomly created antialiased contexts due to an uninitialized variable in its @ref Platform::EmscriptenApplication::GLConfiguration "GLConfiguration" diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 8ec3952ac..94d68e50b 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -660,7 +660,7 @@ Context::Context(NoCreateT, Utility::Arguments& args, Int argc, const char** arg _disabledExtensions.push_back(extension); } -Context::Context(Context&& other): _version{other._version}, +Context::Context(Context&& other) noexcept: _version{other._version}, #ifndef MAGNUM_TARGET_WEBGL _flags{other._flags}, #endif diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index c2e7efb8c..b35c8b725 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -492,7 +492,7 @@ class MAGNUM_GL_EXPORT Context { Context(const Context&) = delete; /** @brief Move constructor */ - Context(Context&& other); + Context(Context&& other) noexcept; ~Context(); diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index 854a98d73..057381a9e 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -89,6 +89,9 @@ void ContextTest::constructCopyMove() { CORRADE_VERIFY((std::is_constructible{})); CORRADE_VERIFY(!(std::is_assignable{})); CORRADE_VERIFY(!(std::is_assignable{})); + + CORRADE_VERIFY(std::is_nothrow_move_constructible::value); + /* No move assignment */ } void ContextTest::makeCurrentNoOp() {