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

            Bug ID: 26436
           Summary: End of non-void function reached behavior
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: kre...@email.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

When there's no return outside of conditional/loop/switch statement, but a
function expects a return type, clang will generate a warning, as expected.

There is one special case, and that's a switch statement where one statement
will always be true because every possible input value has been covered. In
such case, clang shouldn't return a warning, much like gcc does at the moment.

An example for such code can be found at [1]. See also [2].

[1]
https://github.com/systemd/systemd/blob/61f32bff6130a44d077886d38cff89ad161bf177/src/resolve/dns-type.c#L242
[2] https://github.com/systemd/systemd/issues/2504

Linux, clang 3.8.0rc1.

-- 
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