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

            Bug ID: 31373
           Summary: -Wunused-variable does not detect unused condition
                    variable
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: richard-l...@metafoo.co.uk
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

-Wunused-variable does not warn on this case:

bool f();
void g() {
  if (bool b = f()) {
    // ...
  }
}

GCC's version of the warning does. Presumably we're marking the variable as
'used' in the condition handling code; while that's technically correct, it
doesn't lead to the right outcome here.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to