[PATCH] D56581: [ASTImporter] Set the described template if not set

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 00:02:35 PST 2019


martong created this revision.
martong added reviewers: shafik, a_sidorin.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp, rnkovacs.
Herald added a reviewer: a.sidorin.

During the addition of an injected class type to a record it may happen
that a CXXRecordDecl in the redecl chain does not have a described
template set and this caused an assert in LLDB.


Repository:
  rC Clang

https://reviews.llvm.org/D56581

Files:
  lib/AST/ASTImporter.cpp


Index: lib/AST/ASTImporter.cpp
===================================================================
--- lib/AST/ASTImporter.cpp
+++ lib/AST/ASTImporter.cpp
@@ -2734,6 +2734,9 @@
             getCanonicalForwardRedeclChain(D2CXX);
         for (auto *R : Redecls) {
           auto *RI = cast<CXXRecordDecl>(R);
+          // Existing Decl in the chain might not have the described
+          // template set, so we set it now.
+          RI->setDescribedClassTemplate(ToDescribed);
           RI->setTypeForDecl(nullptr);
           // Below we create a new injected type and assign that to the
           // canonical decl, subsequent declarations in the chain will reuse


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56581.181213.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190111/13596819/attachment.bin>


More information about the cfe-commits mailing list