]> granicus.if.org Git - clang/commit
[coroutines][PR41909] Don't build dependent coroutine statements for generic lambda
authorBrian Gesiak <modocache@gmail.com>
Mon, 3 Jun 2019 00:47:32 +0000 (00:47 +0000)
committerBrian Gesiak <modocache@gmail.com>
Mon, 3 Jun 2019 00:47:32 +0000 (00:47 +0000)
commit3932cbe66b32a3d4d4e7d3d0ed92435ded8290d0
tree152b5fd04ad44591be7a29af160f3fa4db6eacb3
parent08899cc77b4558da629f779277390080d7181786
[coroutines][PR41909] Don't build dependent coroutine statements for generic lambda

Summary:
https://bugs.llvm.org/show_bug.cgi?id=41909 describes an issue in which
a generic lambda that takes a dependent argument `auto set` causes the
template instantiation machinery for coroutine body statements to crash
with an ICE. The issue is two-fold:

1. The paths taken by the template instantiator contain several asserts
   that the coroutine promise must not have a dependent type.
2. The template instantiator unconditionally builds corotuine statements
   that depend on the promise type, which cannot be dependent.

To work around the issue, prevent the template instantiator from building
dependent coroutine statements if the coroutine promise type is dependent.
Since we only expect this to occur in the case of a generic lambda, limit
the workaround behavior to just that case.

Reviewers: GorNishanov, EricWF, lewissbaker, tks2103

Reviewed By: GorNishanov

Subscribers: cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362348 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/TreeTransform.h
test/SemaCXX/coroutines.cpp