[all-commits] [llvm/llvm-project] b72a36: [C++20] [Coroutines] Exit early if we found co_awa...

Chuanqi Xu via All-commits all-commits at lists.llvm.org
Sun Oct 9 00:01:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b72a364bb5ccc4ad50f3e28b6706db86987d961b
      https://github.com/llvm/llvm-project/commit/b72a364bb5ccc4ad50f3e28b6706db86987d961b
  Author: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
  Date:   2022-10-09 (Sun, 09 Oct 2022)

  Changed paths:
    M clang/lib/Sema/SemaCoroutine.cpp
    M clang/test/SemaCXX/Inputs/std-coroutine.h
    A clang/test/SemaCXX/coroutine-decltype.cpp
    M clang/test/SemaCXX/coroutines-exp-namespace.cpp
    M clang/test/SemaCXX/coroutines.cpp

  Log Message:
  -----------
  [C++20] [Coroutines] Exit early if we found co_await appears in
unevaluated context

Closes https://github.com/llvm/llvm-project/issues/58133

The direct cause for this issue is that the compilation process
continues after it found it is in a invalid state. [expr.await]p2 says
clearly that the co_await expressions are not allowed to appear in
unevaluated context. So we can exit early in this case. It also reduces
many redundant diagnostic messages (Such as 'expression with side
effects has no effect in an unevaluated context').




More information about the All-commits mailing list