Page MenuHomePhabricator

Fix PR19195
AbandonedPublic

Authored by karthikthecool on Apr 1 2014, 4:22 AM.

Details

Summary

Hi All,
A small patch ti fix PR19195. A call to getExpr from CXXDefaultInitExpr can return null in case we have not yet parsed and attached the in class initializer like in this test case.
Check if getExpr returns null and handle the same to prevent a crash during dynamic cast in StmtVisitor.
It would be great if someone could review the same and let me know if this is good for commit.

Thanks
Karthik Bhat

Diff Detail

Event Timeline

ping..

Thanks
Karthik Bhat

This doesn't look right to me. If the initializer hasn't been parsed by the time we get to IR generation for the default constructor, something has gone *very* badly wrong.

The right fix here is probably to implement the proposed resolution for CWG issue 1396 -- lazily instantiate default initializers for non-static data members as we do for default arguments.

karthikthecool abandoned this revision.Jun 12 2016, 10:05 AM

Abandon old review as im no longer working on the same.
Thanks