Skip to content

Commit

Permalink
Utility: fix FileWatcher move assignment on libstdc++ < 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Nov 5, 2018
1 parent 1f875e6 commit c32b096
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/Corrade/Utility/FileWatcher.cpp
Expand Up @@ -57,11 +57,8 @@ FileWatcher::FileWatcher(FileWatcher&&) noexcept = default;
FileWatcher::~FileWatcher() = default;

FileWatcher& FileWatcher::operator=(FileWatcher&&)
/* Clang 3.8 (the one I'm using for ASan builds on Travis) complains that
the calculated implicit move constructor doesn't match this declaration.
Maybe because it's deleting the string instead of swapping. So no
noexcept for you then. */
#if !defined(__clang__) || __clang_major__*100 + __clang_minor__ > 308
/* See the header for details */
#if (!defined(__clang__) && !defined(__GNUC__)) || __clang_major__*100 + __clang_minor__ > 308 || __GNUC__*100 + __GNUC_MINOR__ >= 505
noexcept
#endif
= default;
Expand Down
12 changes: 7 additions & 5 deletions src/Corrade/Utility/FileWatcher.h
Expand Up @@ -82,11 +82,13 @@ class CORRADE_UTILITY_EXPORT FileWatcher {

/** @brief Move assignment */
FileWatcher& operator=(FileWatcher&&)
/* Clang 3.8 (the one I'm using for ASan builds on Travis)
complains that the calculated implicit move constructor doesn't
match this declaration. Maybe because it's deleting the string
instead of swapping. So no noexcept for you then. */
#if !defined(__clang__) || __clang_major__*100 + __clang_minor__ > 308
/* std::string move assignment in libstdc++ before 5.5 is not
noexcept: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265
It went through on GCC 4.7, but apparently only because it
doesn't care. This also affect Clang 3.8 I'm using on Travis CI
for ASan builds and since it's impossible to check for a
libstdc++ version, I'm disabling it for Clang as well. */
#if (!defined(__clang__) && !defined(__GNUC__)) || __clang_major__*100 + __clang_minor__ > 308 || __GNUC__*100 + __GNUC_MINOR__ >= 505
noexcept
#endif
;
Expand Down

0 comments on commit c32b096

Please sign in to comment.