Fix semantic checks for enum and entity name

 - the problem with tags that were not visible after a header file
   inclusion is solved,
 - the case when the name of the entity is not name to the file's name
   is now properly handled (the redeclaration error does not occur),