This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix crash when passing a braced-init list to a parentehsized aggregate init expression
ClosedPublic

Authored by ayzhao on May 30 2023, 4:32 PM.

Details

Summary

The previous code incorrectly assumed that we would never call
warnBracedScalarInit(...) with a EK_ParenAggInitMember. This patch fixes
the bug by warning when a scalar member is initialized via a braced-init
list when performing a parentehsized aggregate initialization. This
behavior is consistent with parentehsized list aggregate initialization.

Fixes #63008

Diff Detail

Event Timeline

ayzhao created this revision.May 30 2023, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 4:32 PM
ayzhao requested review of this revision.May 30 2023, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 4:32 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
shafik accepted this revision.May 30 2023, 5:34 PM

Thank you for the quick fix! LGTM

This revision is now accepted and ready to land.May 30 2023, 5:34 PM
shafik added a reviewer: Restricted Project.May 30 2023, 5:34 PM
ayzhao updated this revision to Diff 526858.May 30 2023, 5:46 PM

rebase to see if this fixes CI

ayzhao updated this revision to Diff 527099.May 31 2023, 9:56 AM

rebasing, CI seems to be fixed now