[llvm-bugs] [Bug 46693] New: Control flow analysis is missing for Obj-C @try/@catch/@finally, -Wreturn-type not produced

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 12 09:55:13 PDT 2020


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

            Bug ID: 46693
           Summary: Control flow analysis is missing for Obj-C
                    @try/@catch/@finally, -Wreturn-type not produced
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jacob at bandes-stor.ch
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Symptom: an Objective-C method declared as returning non-void, but without a
return statement, produces no warning if the method contains an Obj-C exception
handling block.

- (int)foo {
    // Missing return, -Wreturn-type is produced
}

- (int)bar {
    @try { }
    @finally { }
    // Missing return but no warning!
}


Root cause:
CFGBuilder simply does not have an implementation for ObjCAtTryStmt,
ObjCAtCatchStmt, etc. It's been missing for 11 years.

There was briefly partial support:
https://github.com/llvm/llvm-project/commit/89cc8ea794b79d6dfd1aa50c665e352791ffa15c

But it was removed:
https://github.com/llvm/llvm-project/commit/89be6526c3a75f608d2c00c18bde8413547aa509

-- 
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/20200712/3d8c7862/attachment.html>


More information about the llvm-bugs mailing list