[Bug debug/86675] New: C++ lambdas are not debugable with -std=c++17 (or above) and -Og

bernd.amend at outlook dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 25 14:59:00 GMT 2018


            Bug ID: 86675
           Summary: C++ lambdas are not debugable with -std=c++17 (or
                    above) and -Og
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bernd.amend at outlook dot com
  Target Milestone: ---

Created attachment 44440
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44440&action=edit
Example program

If I compile the attached (main.cpp) test program
  int main() {
        return [] {
                return 000031415;

with the following options I'm unable to debug it
  g++ main.cpp -std=c++17 -g -Og
  g++ main.cpp -std=c++2a -g -Og

using the following compile options debugging works as expected
  g++ main.cpp -std=c++17 -g -O0
  g++ main.cpp -std=c++2a -g -O0
  g++ main.cpp -std=c++11 -g -Og
  g++ main.cpp -std=c++14 -g -Og
  g++ main.cpp -std=c++14 -g -Og

The attached script test.sh reports the following
Success: Standard c++11 Optimization 0
Success: Standard c++14 Optimization 0
Success: Standard c++17 Optimization 0
Success: Standard c++2a Optimization 0
Success: Standard c++11 Optimization g
Success: Standard c++14 Optimization g
Failed: Standard c++17 Optimization g
Failed: Standard c++2a Optimization g

Systems used: Archlinux (last updated 2018-07-25)
g++ -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --enable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 8.1.1 20180531 (GCC)

More information about the Gcc-bugs mailing list