[coroutines] Diagnose when promise types fail to declare either return_void or return...
authorEric Fiselier <eric@efcs.ca>
Thu, 25 May 2017 14:59:39 +0000 (14:59 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 25 May 2017 14:59:39 +0000 (14:59 +0000)
commit2640abdd4d882ec76a2f2cc97949e5b1394605ab
treec095b75442b719a98d13acb5a4e2e9898f27c18b
parent37a1cf7528130751151a50d8ecdeb370da3539e2
[coroutines] Diagnose when promise types fail to declare either return_void or return_value.

Summary:
According to the PDTS it's perfectly legal to have a promise type that defines neither `return_value` nor `return_void`. However a coroutine that uses such a promise type will almost always have UB, because it can never `co_return`.

This patch changes Clang to diagnose such cases as an error. It also cleans up some of the diagnostic messages relating to member lookup in the promise type.

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303868 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaCoroutine.cpp
test/SemaCXX/coreturn.cpp
test/SemaCXX/coroutines.cpp