This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix PR30664
Needs ReviewPublic

Authored by arphaman on Oct 18 2016, 3:23 AM.

Details

Reviewers
rsmith
Summary

This patch fixes an assertion failure crash that happens when a constant record reference member is initialized using an empty initializer list.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 74963.Oct 18 2016, 3:23 AM
arphaman retitled this revision from to [Sema] Fix PR30664.
arphaman updated this object.
arphaman added a reviewer: rsmith.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: cfe-commits.
rsmith added inline comments.Oct 27 2016, 12:16 AM
lib/Sema/SemaExprCXX.cpp
3429–3430

I think you mean "if the constructor has no parameters", right?

3433

It looks like this will result in us building an expression like T(void({})). That would be invalid, and we shouldn't have it in the AST. Instead, we should probably build T{} for this case.

test/SemaCXX/cxx11-crashes.cpp
109

This case is ill-formed under http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1696

Is there any way to tickle this problem without binding a class member to a temporary? If not, I'd prefer we instead implement DR1696 to eliminate the problem.