[all-commits] [llvm/llvm-project] 376cf4: [coroutines][PR41909] Generalize fix from D62550

Brian Gesiak via All-commits all-commits at lists.llvm.org
Mon Dec 16 14:43:46 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 376cf43729c8025eecbd2969522c5687f2a3919f
      https://github.com/llvm/llvm-project/commit/376cf43729c8025eecbd2969522c5687f2a3919f
  Author: Brian Gesiak <modocache at gmail.com>
  Date:   2019-12-16 (Mon, 16 Dec 2019)

  Changed paths:
    M clang/lib/Sema/TreeTransform.h
    M clang/test/SemaCXX/coroutines.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list