[LLVMbugs] [Bug 9969] New: Warn about missing parameters for ?: operator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 20 09:36:42 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9969

           Summary: Warn about missing parameters for ?: operator
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hans at chromium.org
                CC: llvmbugs at cs.uiuc.edu


http://www.viva64.com/en/d/0091/ seems to warn on this code:

int foo(int a, bool b, int c, int d) { 
  return a + b ? c : d;
}

In this case it's likely that the programmer really meant to write

int foo(int a, bool b, int c, int d) { 
  return a + (b ? c : d);
}

Maybe Clang should warn about this too?

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list