Currently, this is only diagnosed but the decl is not marked invalid. This may hit assertions down the path.
This also reverts the fix for PR49534 since it is not needed anymore.
Differential D113145
[Sema] Mark virtual method declaration in union as invalid ychen on Nov 3 2021, 2:32 PM. Authored by
Details Currently, this is only diagnosed but the decl is not marked invalid. This may hit assertions down the path. This also reverts the fix for PR49534 since it is not needed anymore.
Diff Detail
Event TimelineComment Actions @ychen, an alternative fix would be to avoid getting asking for the layout for a broken union like this. Would it be appropriate to mark the RecordDecl in Sema such that isInvalidDecl returns true? Is that already happening? Comment Actions Yeah, that would be better. I just realized it earlier today. I'll attempt that instead. Thanks for the suggestion. Comment Actions LGTM; thanks! fyi, I'll be on vacation for the next three weeks. I've added some additional reviewers to the patch based on prior reviews. |