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

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 6 17:17:04 PST 2018


vsapsai added inline comments.


================
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));
----------------
rsmith wrote:
> 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.)
Uploaded a new patch. Is this what you had in mind by not having two different declarations that think they're the definition?


https://reviews.llvm.org/D43494





More information about the cfe-commits mailing list