https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120640
--- Comment #2 from Vlad Serebrennikov <serebrennikov.vladislav at gmail dot com> --- Yes, because in this case it's an elaborated-type-specifier, and name lookup is type-only. The original example should be diagnosed in pedantic mode at the very least.