[Bug libstdc++/90314] [10 Regression] clang gives error about exception specification in declaration not matching definition after change in move.h

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 2 21:24:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90314

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu May  2 21:23:38 2019
New Revision: 270827

URL: https://gcc.gnu.org/viewcvs?rev=270827&root=gcc&view=rev
Log:
PR libstdc++/90314 fix non-equivalent declarations of std::swap

In order to use the _GLIBCXX_NOEXCEPT_IF macro for an expression
containing commas I enclosed it in parentheses, so the preprocessor
wouldn't treat it as two arguments to the function-like macro. Clang
gives an error because now the noexcept-specifier noexcept((C)) is not
equivalent to the noexcept(C) one on the declaration of swap in
<type_traits>.

Instead of requiring extra parentheses around the expression, redefine
_GLIBCXX_NOEXCEPT_IF as a variadic macro (even though supporting that in
C++98 is a GNU extension).

        PR libstdc++/90314
        * include/bits/c++config (_GLIBCXX_NOEXCEPT_IF): Use variadic macro.
        * include/bits/move.h (swap): Remove extra parentheses.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/c++config
    trunk/libstdc++-v3/include/bits/move.h


More information about the Gcc-bugs mailing list