This is an archive of the discontinued LLVM Phabricator instance.

[clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter
ClosedPublic

Authored by steakhal on Sep 3 2021, 7:38 AM.

Diff Detail

Event Timeline

steakhal created this revision.Sep 3 2021, 7:38 AM
steakhal requested review of this revision.Sep 3 2021, 7:38 AM
steakhal added inline comments.
clang/lib/AST/ASTImporter.cpp
1493

I know it's somewhat ugly, but it gets the job done.
There are other instances like this already.

martong accepted this revision.Sep 3 2021, 7:52 AM

Nice work, thanks!

clang/lib/AST/ASTImporter.cpp
1493

It is unfortunate that we can't we import the Type ptr directly and we must create a qualified type with meaningless qualifiers. However, we use the very same methods for VisitSubstTemplateTypeParmType so, this is okay for now. Perhaps, in a later patch it would make sense to create an import overload that returns and Exptected<Type*> and takes Type* as a param. That could simplify this line and the cast below.

clang/unittests/AST/ASTImporterTest.cpp
4699

Good test!

This revision is now accepted and ready to land.Sep 3 2021, 7:52 AM
shafik accepted this revision.Sep 3 2021, 10:06 AM

LGTM, please run the check-lldb before landing this since lldb can be sensitive to ASTImporter changes and it is nice to catch regressions there before landing.

Herald added a project: Restricted Project. · View Herald TranscriptSep 4 2021, 1:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

LGTM, please run the check-lldb before landing this since lldb can be sensitive to ASTImporter changes and it is nice to catch regressions there before landing.

The patch did not introduce new failures.

steakhal added inline comments.Sep 4 2021, 4:38 AM
clang/lib/AST/ASTImporter.cpp
1493

D109269 aims to address this.