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

            Bug ID: 79249
           Summary: Lambda call does not create exception handler.
           Product: gcc
           Version: 6.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jesse at mind dot net
  Target Milestone: ---

Created attachment 40593
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40593&action=edit
Small program that triggers the bug.

When the attached program executes, a call to std::terminate() results rather
than the expected call to an exception handler. 

Compile with:
g++-6 --std=c++14 -O0  -o ./minimal_break-gcc ./minimal_break.cpp

Expected output:
exception caught: std::exception

Observed output:
terminate called after throwing an instance of 'std::exception'
  what():  std::exception
Aborted

Note:
Looking at the assembly output, it appears that code for checking exceptions is
not generated in main().

Compiler information:
Using built-in specs.
COLLECT_GCC=g++-6
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/6/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada,go
--enable-offload-targets=hsa --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/6 --enable-ssp --disable-libssp
--disable-libvtv --disable-libcc1 --disable-plugin
--with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux'
--disable-libgcj --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--with-default-libstdcxx-abi=gcc4-compatible
--enable-version-specific-runtime-libs --enable-linker-build-id
--enable-linux-futex --enable-gnu-indirect-function --program-suffix=-6
--without-system-libunwind --enable-multilib --with-arch-32=x86-64
--with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 6.2.1 20161214 [gcc-6-branch revision 243648] (SUSE Linux) 

Note: Appears to also occur with GCC7.

Reply via email to