This is an archive of the discontinued LLVM Phabricator instance.

[c++17] Fix assertion on synthesizing deduction guides after a fatal error.
ClosedPublic

Authored by vsapsai on May 4 2018, 12:23 PM.

Details

Summary

After a fatal error Sema::InstantiatingTemplate doesn't allow further
instantiation and doesn't push a CodeSynthesisContext. When we tried to
synthesize implicit deduction guides from constructors we hit the
assertion

Assertion failed: (!CodeSynthesisContexts.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"), function SubstType, file clang/lib/Sema/SemaTemplateInstantiate.cpp, line 1580.

Fix by avoiding deduction guide synthesis if InstantiatingTemplate is invalid.

rdar://problem/39051732

Diff Detail

Repository
rL LLVM

Event Timeline

vsapsai created this revision.May 4 2018, 12:23 PM
rsmith accepted this revision.May 14 2018, 2:43 PM

LGTM, thanks!

This revision is now accepted and ready to land.May 14 2018, 2:43 PM
This revision was automatically updated to reflect the committed changes.

Thanks for the review.