[PATCH] D158869: [clang] Fix timing of propagation of MSInheritanceAttr for template instantiation declarations.
Tom Honermann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 25 11:28:27 PDT 2023
tahonermann added reviewers: rnk, zequanwu.
tahonermann added a comment.
Adding Erich as attributes owner, and Reid and Zequan for MS ABI. This patch slightly modifies the changes made via D94646 <https://reviews.llvm.org/D94646> and committed as rG4fffbc150cca1638051b8ad2a20f4b8240df0869 <https://reviews.llvm.org/rG4fffbc150cca1638051b8ad2a20f4b8240df0869> for GH48031 <https://github.com/llvm/llvm-project/issues/48031>.
================
Comment at: clang/lib/Sema/SemaTemplate.cpp:10112
+ Specialization->addAttr(PrevDecl->getAttr<MSInheritanceAttr>());
+ Consumer.AssignInheritanceModel(Specialization);
+ }
----------------
I am concerned that moving the call to `Consumer.AssignInheritanceModel()` to immediately after the creation of the node, but before it is populated might be problematic. Previously, this call was still made before the node was completely constructed (e.g., before `setTemplateSpecializationKind()` is called for it). It is difficult to tell if any consumers might be dependent on more of the definition being present.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158869/new/
https://reviews.llvm.org/D158869
More information about the cfe-commits
mailing list