https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92088 --- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- grokdeclarator would be one place to put a check (e.g. near where it already disallows non-nested functions with variably modified types).