This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix a pair of crashes when generating exception specifiers with an error'ed field for a template class' default ctor.
ClosedPublic

Authored by erichkeane on Sep 14 2017, 2:02 PM.

Details

Summary

The two examples in the test would both cause a compiler assert when attempting to calculate
the exception specifier for the default constructor for the template classes. The problem was
that dependents of this function expect that Field->getInClassInitializer (including canThrow) is
not nullptr. However, if the template's initializer has an error, exactly that situation happens.

This patch simply sets the field to be invalid.

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Sep 14 2017, 2:02 PM

Ping? I Added the three of you because you were all on the git-blame list, but if you have better ideas on someone to review this, it would be appreciated.

-Erich

rnk accepted this revision.Sep 18 2017, 2:02 PM

Looks like the correct fix, thanks!

This revision is now accepted and ready to land.Sep 18 2017, 2:02 PM
This revision was automatically updated to reflect the committed changes.