https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79457
--- Comment #1 from Teemu Piippo <teemu at hecknology dot net> --- If the "S" declaration is removed and the decltype(...) moved into the return type of Foo::boo(), GCC does not crash and builds the example properly.