[PATCH] D109237: [clang][AST] Add support for SubstTemplateTypeParmPackType to ASTImporter

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 4 04:38:55 PDT 2021


steakhal added inline comments.


================
Comment at: clang/lib/AST/ASTImporter.cpp:1493
+    const SubstTemplateTypeParmPackType *T) {
+  ExpectedType ReplacedOrErr = import(QualType(T->getReplacedParameter(), 0));
+  if (!ReplacedOrErr)
----------------
martong wrote:
> steakhal wrote:
> > I know it's somewhat ugly, but it gets the job done.
> > There are other instances like this already.
> 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.
D109269 aims to address this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109237



More information about the cfe-commits mailing list