================
@@ -1571,9 +1571,10 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) 
{
     } else {
       Record.push_back(0);
     }
-    // For lambdas inside canonical FunctionDecl remember the mapping.
+    // For lambdas inside template functions, remember the mapping to
+    // deserialize them together.
     if (auto FD = llvm::dyn_cast_or_null<FunctionDecl>(D->getDeclContext());
-        FD && FD->isCanonicalDecl()) {
+        FD && FD->isDependentContext() && FD->isThisDeclarationADefinition()) {
----------------
hokein wrote:

This line looks identical to the one on line 
[807](https://github.com/llvm/llvm-project/blob/0f9e913466982b92776d6ff748df48af28631517/clang/lib/Serialization/ASTWriterDecl.cpp#L807).
 I guess we can pull out a small function.

https://github.com/llvm/llvm-project/pull/123648
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to