[PATCH] D92101: [Clang][Sema] Attempt to fix CTAD faulty copy of non-local typedefs

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 02:36:01 PST 2020


martong added a comment.

@rsmith I have moved the check into `TransformTypedefType`. We do not add the typedef to the `MaterializedTypedefs` list if it's context is dependent because later we set the deduction guide as the DC for all typedefs in the list:

  for (auto *TD : MaterializedTypedefs)
    TD->setDeclContext(Guide);

Also, we have to push the original TypedefDecl to the `TypeLocBuilder`, otherwise an assertion would fire:

  llvm-project/clang/lib/Sema/TypeLocBuilder.h:103: clang::TypeSourceInfo* clang::TypeLocBuilder::getTypeSourceInfo(clang::ASTContext&, clang::QualType): Assertion `T == LastTy && "type doesn't match last type pushed!"' failed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92101



More information about the cfe-commits mailing list