: g++-7 --version g++-7 (SUSE Linux) 7.3.1 20180817 [gcc-7-branch revision 263612] Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. : cat test.ii struct Test { Test(); Test(Test &); int getint(); }; template <typename Applier> void call_applier(Applier && f) { f(int()); } Test run() { Test test; call_applier([=](auto) { sizeof(test.getint()); }); return test; } : g++-7 -std=c++1z -Wmissing-format-attribute -c test.ii test.ii: In instantiation of ‘run()::<lambda(auto:1)> [with auto:1 = int]’: test.ii:9:5: required from ‘void call_applier(Applier&&) [with Applier = run()::<lambda(auto:1)>]’ test.ii:16:5: required from here test.ii:15:25: internal compiler error: Segmentation fault sizeof(test.getint()); ~~~~~~~~~~~~^~~ Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.opensuse.org/> for instructions. Note the weird -Wmissing-format-attribute flag which is required to trigger the crash, although it seems to be completely unrelated.
Confirmed, only GCC-7 branch is affected. Fixed on trunk in r236615.
Fixed in GCC 8.