[llvm-bugs] [Bug 18561] No warning for unused computed values in comma expressions

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jul 9 18:07:42 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=18561

Nick Lewycky <nicholas at mxc.ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |nicholas at mxc.ca
         Resolution|---                         |FIXED

--- Comment #1 from Nick Lewycky <nicholas at mxc.ca> ---
It's -Wcomma in clang.

$ llvm-commit/build/bin/clang pr18561.cc -Wcomma -fsyntax-only
pr18561.cc:4:20: warning: possible misuse of comma operator here [-Wcomma]
  return (f() && a), 1;
                   ^
pr18561.cc:4:10: note: cast expression to void to silence warning
  return (f() && a), 1;
         ^~~~~~~~~~
         static_cast<void>( )
1 warning generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160710/2b962c52/attachment.html>


More information about the llvm-bugs mailing list