[coroutines][PR41909] Generalize fix from D62550
authorBrian Gesiak <modocache@gmail.com>
Mon, 16 Dec 2019 22:19:16 +0000 (17:19 -0500)
committerBrian Gesiak <modocache@gmail.com>
Mon, 16 Dec 2019 22:43:04 +0000 (17:43 -0500)
commit376cf43729c8025eecbd2969522c5687f2a3919f
treef5bfa80912f5d510b974579ebadda09e8767d85d
parent3fbe518a102a344abbd837e364a404c0c695d183
[coroutines][PR41909] Generalize fix from D62550

Summary:
In https://reviews.llvm.org/D62550 @rsmith pointed out that there are
many situations in which a coroutine body statement may be
transformed/rebuilt as part of a template instantiation, and my naive
check whether the coroutine was a generic lambda was insufficient.

This is indeed true, as I've learned by reading more of the
TreeTransform code. Most transformations are written in a way that
doesn't assume the resulting types are not dependent types. So the
assertion in 'TransformCoroutineBodyStmt', that the promise type must no
longer be dependent, is out of place.

This patch removes the assertion, spruces up some code comments, and
adds a test that would have failed with my naive check from
https://reviews.llvm.org/D62550.

Reviewers: GorNishanov, rsmith, lewissbaker

Reviewed By: rsmith

Subscribers: junparser, EricWF, rsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D70579
clang/lib/Sema/TreeTransform.h
clang/test/SemaCXX/coroutines.cpp