[Bug libstdc++/85642] [8/9 Regression] Wrong implicit exception-specification with std::optional

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 4 09:58:00 GMT 2018


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Fri May  4 09:57:42 2018
New Revision: 259930

URL: https://gcc.gnu.org/viewcvs?rev=259930&root=gcc&view=rev
Log:
PR libstdc++/85642 fix is_nothrow_default_constructible<optional<T>>

Add missing noexcept keyword to default constructor of each
_Optional_payload specialization.

        PR libstdc++/85642 fix is_nothrow_default_constructible<optional<T>>
        * include/std/optional (_Optional_payload): Add noexcept to default
        constructor. Re-indent.
        (_Optional_payload<_Tp, true, true, true>): Likewise. Add noexcept to
        constructor for copying disengaged payloads.
        (_Optional_payload<_Tp, true, false, true>): Likewise.
        (_Optional_payload<_Tp, true, true, false>): Likewise.
        (_Optional_payload<_Tp, true, false, false>): Likewise.
        * testsuite/20_util/optional/cons/85642.cc: New.
        * testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error lines.

Added:
    branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/optional/cons/85642.cc
Modified:
    branches/gcc-8-branch/libstdc++-v3/ChangeLog
    branches/gcc-8-branch/libstdc++-v3/include/std/optional
   
branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/optional/cons/value_neg.cc


More information about the Gcc-bugs mailing list