]> granicus.if.org Git - clang/commit
[c++17] Fix assertion on synthesizing deduction guides after a fatal error.
authorVolodymyr Sapsai <vsapsai@apple.com>
Mon, 14 May 2018 22:49:44 +0000 (22:49 +0000)
committerVolodymyr Sapsai <vsapsai@apple.com>
Mon, 14 May 2018 22:49:44 +0000 (22:49 +0000)
commit82cd820babf3a0f09c8e566a8445b3eee09412f4
treebcaf5f6c5b27e7000884bad35d478eb899cfd3ce
parenta9d58a0e9d093cd581122e3d4c2c963615ae4431
[c++17] Fix assertion on synthesizing deduction guides after a fatal error.

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

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D46446

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332307 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplate.cpp
test/SemaTemplate/instantiate-after-fatal-cxx17.cpp [new file with mode: 0644]