This is an archive of the discontinued LLVM Phabricator instance.

[ASTImporter] Add support for import of CXXInheritedCtorInitExpr.
ClosedPublic

Authored by balazske on Jul 13 2018, 6:59 AM.

Diff Detail

Repository
rC Clang

Event Timeline

balazske created this revision.Jul 13 2018, 6:59 AM

Adding new nodes is always welcome.

lib/AST/ASTImporter.cpp
6782

cast_or_null?

balazske added inline comments.Jul 16 2018, 12:46 AM
lib/AST/ASTImporter.cpp
6782

dyn_cast_or_null: Import may return nullptr, but if not, the cast should succeed (not a CXXConstructorDecl would be error).
Or (but some lines more code) check separately for null return from Import, and then use cast?

a_sidorin added inline comments.Jul 16 2018, 3:55 PM
lib/AST/ASTImporter.cpp
6782

Usually, we explicitly check that the imported decl has the same kind as the source one by filtering lookup results or by creating a decl of same kind. So, it's better to assert with cast_or_null in case of kind mismatch.

balazske updated this revision to Diff 155838.Jul 17 2018, 3:46 AM
  • Using cast_or_null
martong accepted this revision.Jul 24 2018, 7:03 AM
This revision is now accepted and ready to land.Jul 24 2018, 7:03 AM
This revision was automatically updated to reflect the committed changes.