This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Don't crash when initializing an incomplete list-initialized variable
Needs ReviewPublic

Authored by majnemer on Apr 9 2015, 11:46 PM.

Details

Reviewers
rsmith
Summary

A list-initialized variable may have an initializer of incomplete type.
We didn't ensure the sub-element type was complete before we
interrogated certain properties of the type.

Diff Detail

Event Timeline

majnemer updated this revision to Diff 23568.Apr 9 2015, 11:46 PM
majnemer retitled this revision from to [Sema] Don't crash when initializing an incomplete list-initialized variable.
majnemer updated this object.
majnemer added a reviewer: rsmith.
majnemer added a subscriber: Unknown Object (MLST).
rsmith added inline comments.Apr 17 2015, 8:01 PM
lib/Sema/SemaExprCXX.cpp
5113–5115

I think this is the wrong place for this: the code creating the rvalue should be checking that its type is complete.