Checking constructor_name_p doesn't work for an enum, and there's no reason to check it for non-classes anyway. The change to cp_parser_invalid_type_name is to avoid saying that a scoped enum is a class; now it will print the actual tag used in defining the type. Tested x86_64-pc-linux-gnu, applying to trunk.