This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/67726] New: std::condition_variable::wait can throw, but should terminate.


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

            Bug ID: 67726
           Summary: std::condition_variable::wait can throw, but should
                    terminate.
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

We do not meet this requirement in [thread.condition.condvar]:

Remarks: If the function fails to meet the postcondition, std::terminate()
shall be called (15.5.1).
[ Note: This can happen if the re-locking of the mutex throws an exception. â
end note ]


We can solve it for both wait overloads by adding noexcept to the
wait(unique_lock<mutex>&) overload.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]