[PATCH] D156461: [clang][ASTImporter] Merge implicit ctors with definition

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 13 23:52:17 PDT 2023


balazske added a comment.

It looks not good to remove an invalid node from the DeclContext that otherwise remains in the AST. I checked the problem and found that the existing move constructor (originally in the To AST which had no definition) gets a `getNumCtorInitializers` value of 1 but the `init_begin` returns 0. This causes crash even when dumping it. I did not find the cause of this situation (the first time at line 3822 it is already changed, and `ASTImporter` has this single position to change the value). Normally what should happen is that a new move constructor is imported (with a definition) and linked after the existing one (and the existing is not modified). We get an AST that does not occur after a normal compile, I do not know if this causes problems or if this is the real reason for this patch. What should be done is find the existing constructor and update it with the definition and return it from the import. This can be done with any type of constructor.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156461



More information about the cfe-commits mailing list