[PATCH] D74639: Add linkage check to ASTNodeImporter::hasSameVisibilityContext and rename to hasSameVisibilityContextAndLinkage

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 17 02:38:07 PST 2020


balazske added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:989
            !Found->hasExternalFormalLinkage();
 }
 
----------------
This would be equivalent but more clear code (formatting is probably not correct here):
```
  if (Found->getLinkageInternal() != From->getLinkageInternal())
    return false;

  if (From->hasExternalFormalLinkage())
    return true;

  return Importer.GetFromTU(Found) == From->getTranslationUnitDecl() &&
         From->isInAnonymousNamespace() == Found->isInAnonymousNamespace();
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74639/new/

https://reviews.llvm.org/D74639





More information about the cfe-commits mailing list