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

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 13:07:25 PST 2020


shafik created this revision.
shafik added reviewers: martong, teemperor, balazske, a_sidorin.
Herald added a subscriber: rnkovacs.

This fixed is based on the assert in `LinkageComputer::getLVForDecl(…)` which assumes that all the decls in a redecl chain have the same linkage.

This change was trigged by a bug that came up when debugging `llc` and running the following expression in while in `SelectionDAG::getNode(…)

  p VT.getVectorElementType() == Operand.getValueType()

Evaluating this expression leads to import of an `operator==` for I believe a `std::set` iterator. One with external linkage and one with unique external linkage but they end in the same redecl chain which triggers the assert in `LinkageComputer::getLVForDecl(…)`.

This case has proven difficult to reduce to a minimal test case.


https://reviews.llvm.org/D74639

Files:
  clang/lib/AST/ASTImporter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74639.244744.patch
Type: text/x-patch
Size: 3969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200214/ec84e277/attachment.bin>


More information about the cfe-commits mailing list