clang icon indicating copy to clipboard operation
clang copied to clipboard

Previously found Decl should be linked right after create

Open martong opened this issue 7 years ago • 1 comments

Import starts with a lookup and then we create a new Decl. Then in certain cases (e.g. CXXConstructorDecl) we further import other Decls (base classes, members through CXXConstructorDecl::inits()) before connecting the redecl chain. During those in-between imports structural eq fails because the canonical decl is different.

Currently this problem impacts only CXXConstructorDecl, however we plan to properly import the redecl chains in other kind of Decls too. Thus, we should add a new PrevDecl parameter to GetImportedOrCreateDecl on a long term.

martong avatar Oct 12 '18 09:10 martong

This implies that first we have to implement the import of the redecl chains for all nodes. E.g. EnumDecl, VarTemplateDecl, and lot of other nodes still do not handle the redecl chain properly.

martong avatar Oct 26 '18 16:10 martong