[llvm] r304083 - Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]. NFC.

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 3 22:25:17 PDT 2017


Unfortunately, a do { ... } while (0) wrapper wouldn't work either. Because
of usages like this:

ASSERT_EQ(&TestOption, Retrieved) << "Retrieved wrong option.";

Galina

On Sun, May 28, 2017 at 2:41 PM, Joerg Sonnenberger via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> On Sat, May 27, 2017 at 10:30:54PM -0700, Craig Topper via llvm-commits
> wrote:
> > EXPECT_STREQ should already be using this as far as I can tell.
>
> GTEST_ASSERT_ should get a do { ... } while (0) wrapper. That's much
> better than the switch statement it is currently trying to use.
>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170603/7929b37e/attachment.html>


More information about the llvm-commits mailing list