https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88003
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> --- That is, with this version of the test: auto test() { struct O { struct N; }; return O(); } typedef decltype(test()) TN; struct TN::N {};