================
@@ -18,7 +18,8 @@ void infer_void_return_type(int i) {
switch (x) {
case 0: return get<void>();
case 1: return;
- case 2: return { 1, 2.0 }; // expected-error {{cannot deduce lambda return
type from initializer list}}
+ case 2: return { 1, 2.0 }; // expected-error {{cannot deduce lambda return
type from initializer list}} \
+ // cxx11-error {{void lambda should not
return a value}}
----------------
Ko496-glitch wrote:
> @Ko496-glitch Ah, found it, we end up in the `else if
> (CurCap->HasImplicitReturnType)` branch; in there, we should probably set
> `RetValExpr = nullptr` after issuing the `err_lambda_return_init_list`
> diagnostic; for some reason we don’t do that there...
how did you find this ?
https://github.com/llvm/llvm-project/pull/188904
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits