https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120585
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>Perhaps there's a `typeof` involved somehow behind the scenes
There is not. typeof is just the last choice for this set of ifs:
```
if (typedef_decl)
{
pedwarn (loc, OPT_Wpedantic,
"%qs specified with typedef-name %qD",
key, typedef_decl);
ok = !flag_pedantic_errors;
/* PR108099: __int128_t comes from c_common_nodes_and_builtins,
and is not built as a typedef. */
if (is_typedef_decl (typedef_decl))
type = DECL_ORIGINAL_TYPE (typedef_decl);
}
else if (declspecs->decltype_p)
error_at (loc, "%qs specified with %<decltype%>", key);
else
error_at (loc, "%qs specified with %<typeof%>", key);
```
Which is why the check for wchar_type_node should be in the previous mentioned
ifs (which comes right before this one).