Index: clang/lib/Sema/SemaInit.cpp =================================================================== --- clang/lib/Sema/SemaInit.cpp +++ clang/lib/Sema/SemaInit.cpp @@ -6924,7 +6924,8 @@ } else if (isa(L)) { Diag(DiagLoc, diag::err_ret_local_block) << DiagRange; } else if (isa(L)) { - Diag(DiagLoc, diag::warn_ret_addr_label) << DiagRange; + if (LK == LK_Return) + Diag(DiagLoc, diag::warn_ret_addr_label) << DiagRange; } else { Diag(DiagLoc, diag::warn_ret_local_temp_addr_ref) << Entity.getType()->isReferenceType() << DiagRange; Index: clang/test/Sema/statements.c =================================================================== --- clang/test/Sema/statements.c +++ clang/test/Sema/statements.c @@ -34,6 +34,15 @@ return &&bar; // expected-warning {{returning address of label, which is local}} } +// PR38569: Don't warn when returning a label from a statement expression. +void test10_logpc(void*); +void test10a() { + test10_logpc(({ + my_pc: + &&my_pc; + })); +} + // PR6034 void test11(int bit) { switch (bit)