This is an archive of the discontinued LLVM Phabricator instance.

Fix MaterializeTemporaryExpr's type when its an incomplete array.
ClosedPublic

Authored by erichkeane on Sep 25 2020, 6:11 AM.

Details

Summary

Like the VarDecl that gets its type updated based on an init-list, this
patch corrects the MaterializeTemporaryExpr's type to make sure it isn't
creating an incomplete type, which leads to a handful of CodeGen crashes
(see PR 47636).

Based on @rsmith 's comments on D88236

Diff Detail

Event Timeline

erichkeane requested review of this revision.Sep 25 2020, 6:11 AM
erichkeane created this revision.
erichkeane added inline comments.
clang/lib/Sema/SemaInit.cpp
8203

It seemed less intrusive/more reliable to fix this during the init-process, and perhaps would fix a few additional cases. The VarDecl gets updated by the caller of this, and updating both the ExprWtihCleanups and MTE seemed error-prone.

*PING!* Any feedback?

Ping! This was requested in post-commit on the last patch, so I'm hoping it shouldn't be too controversial.

rjmccall accepted this revision.Jan 5 2021, 8:30 PM

LGTM

This revision is now accepted and ready to land.Jan 5 2021, 8:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2021, 7:25 AM