https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86037
Bug ID: 86037 Summary: __PRETTY_FUNCTION__ for constexpr lambda's is missing [with = type] Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de Target Milestone: --- Hello gcc-team, this code changed output between gcc-7 and gcc-8 ``` // pretty_function.cpp #include <iostream> #include <string> template <typename type> struct pretty_lambda { static constexpr auto as_string = [] () { return std::string{__PRETTY_FUNCTION__}; }; }; int main() { std::string lambda_int = pretty_lambda<int>::as_string(); std::cout << lambda_int << "\n"; return 0; } ``` compiling with `g++-7 -std=c++17 pretty_function.cpp` outputs: pretty_lambda<type>::<lambda()> [with type = int] compiling with `g++-8 -std=c++17 pretty_function.cpp` outputs: pretty_lambda<int>::<lambda()> Is there a reason for this change? The same class, but with `as_string` as a static function delivers an output with the `[with type = int]` part (i.e., `static auto seqan3::detail::pretty_function<type>::as_string() [with type = int]`). So it seems to me that the general format was not changed. I know that this is in no way a standard function or something, but I would prefer a consistent output. > g++-7 -v Using built-in specs. COLLECT_GCC=g++-7 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc7/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,lto --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 --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --program-suffix=-7 --enable-version-specific-runtime-libs Thread model: posix gcc version 7.3.1 20180406 (GCC) > g++-8 -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/lto-wrapper 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 --with-bugurl=https://bugs.archlinux.org/ --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.0 (GCC) Thank you for your awesome work! Marcel