[PATCH] D106994: [modules] Fix miscompilation when using two RecordDecl definitions with the same name.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 30 17:55:11 PDT 2021


vsapsai added a comment.

Thanks for the review!



================
Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:3328-3331
     // If there's no definition yet, then DC's definition is added by an update
     // record, but we've not yet loaded that update record. In this case, we
     // commit to DC being the canonical definition now, and will fix this when
     // we load the update record.
----------------
rsmith wrote:
> I believe there's no need to have logic matching this case in C because the only way that a class definition can be added by an update record is due to template instantiation. So we can use the simpler logic below for C.
Thanks, it's good to know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106994



More information about the cfe-commits mailing list