Don't warn on returning the address of a label from a statement expression
authorReid Kleckner <rnk@google.com>
Fri, 17 Aug 2018 22:11:31 +0000 (22:11 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 17 Aug 2018 22:11:31 +0000 (22:11 +0000)
commit4c33d197fa77b9434a7e76d9ee80005de58a0026
tree6922ab29026ea7ae2d149c45238b582382b3e80e
parent26f6176f38fbe48df500ed08ff4ae1a11b1aa608
Don't warn on returning the address of a label from a statement expression

Summary:
There isn't anything inherently wrong with returning a label from a
statement expression. In practice, the Linux kernel uses this pattern to
materialize PCs.

Fixes PR38569

Reviewers: niravd, rsmith, nickdesaulniers

Subscribers: cfe-commits

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

llvm-svn: 340101
clang/lib/Sema/SemaInit.cpp
clang/test/Sema/statements.c