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

             Bug #: 12318
           Summary: -Wreturn-type warns on else if chains when last else
                    if always true
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Given an else if chain that has a return statement in each body, and the last
else if condition is always true, -Wreturn-type warns.

int foo(int x) {
  if (x == 5) {
    return 1;
  } else if (x == 3 || true) {
    return 0;
  }
}


return-type.cc:7:1: warning: control may reach end of non-void function
      [-Wreturn-type]
}
^

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to