[llvm-bugs] [Bug 40264] New: Doesn't warn about the unused variable

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 9 00:39:34 PST 2019


            Bug ID: 40264
           Summary: Doesn't warn about the unused variable
           Product: clang
           Version: 7.0
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

In this code

---begin test.cpp---
bool x(bool y) {
  return !y;

void f() {
  bool b = false;
  b |= x(false);
  b |= x(true);
---end test.cpp---

the variable 'b' in 'f' is computed but isn't used, but clang++70 doesn't warn
about this when -Wall is set.

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/20190109/52dec252/attachment-0001.html>

More information about the llvm-bugs mailing list