[Bug c++/112553] New: noexcept lambda does not generate call to terminate

federico at kircheis dot it gcc-bugzilla@gcc.gnu.org
Wed Nov 15 19:44:58 GMT 2023


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

            Bug ID: 112553
           Summary: noexcept lambda does not generate call to terminate
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: federico at kircheis dot it
  Target Milestone: ---

Consider following example

----
void do_something();

void bar(){
    []() noexcept{
    do_something();
    }();
}

----


If "do_something" throws, as the lambda is marked noexcept, there should be a
call to std::terminate, but it is not the case: https://godbolt.org/z/xjqzTdrWG

clang and msvc generate the call to std::terminate


More information about the Gcc-bugs mailing list