================
@@ -1715,32 +1715,22 @@ bool CoroutineStmtBuilder::makeOnFallthrough() {
"cannot make statement while the promise type is dependent");
// [dcl.fct.def.coroutine]/p6
- // If searches for the names return_void and return_value in the scope of
- // the promise type each find any declarations, the program is ill-formed.
// [Note 1: If return_void is found, flowing off the end of a coroutine is
// equivalent to a co_return with no operand. Otherwise, flowing off the end
// of a coroutine results in undefined behavior ([stmt.return.coroutine]). —
// end note]
+ //
+ // Note: A promise type declaring both return_void and return_value was
+ // previously ill-formed, but this is allowed since P3950 which was adopted
+ // into C++2d as a DR.
bool HasRVoid, HasRValue;
LookupResult LRVoid =
lookupMember(S, "return_void", PromiseRecordDecl, Loc, HasRVoid);
----------------
cor3ntin wrote:
Yes, we need to do full overload resolution.
The wording here means a non-ambiguous, satisfied overload is found (it might
be deleted, that's allowed - well, it would fail for other reasons)
Errors in the non-immediate context should be diagnose (ie program ill-formed)
(I was in cwg when this exact point was brought up)
https://github.com/llvm/llvm-project/pull/203974
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits