[PATCH] D43494: [Modules] Fix creating fake definition data for lambdas.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 6 12:10:58 PST 2018

rsmith accepted this revision.
rsmith added inline comments.
This revision is now accepted and ready to land.

Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:1795
   CXXRecordDecl *Canon = D->getCanonicalDecl();
-  if (Canon->DefinitionData) {
+  if (Canon->DefinitionData && Canon->DefinitionData != DD) {
     MergeDefinitionData(Canon, std::move(*DD));
It's a little odd that we'll temporarily have two different declarations that think they're the definition in this case, but I don't actually know of anything that'll go wrong as a result.

(This seems easy to avoid, though, by checking whether there already is a definition earlier.)


More information about the cfe-commits mailing list