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

            Bug ID: 19641
           Summary: @try-@catch allows omitting return
           Product: clang
           Version: trunk
          Hardware: All
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

When functions, Objective-C blocks, or methods which normally require a return
type contain the @try-@catch-@finally directives, no error is emitted if a
return statement is omitted.

id f() {
  @try {

  } @catch (...) {

  } @finally {

  }
  // Expected error about missing return
}

- (id)g {
  @try {
    id var = (^id(void) {
        @try {

        } @catch (...) {

        } @finally {

        }
        // Expected error about missing return
    })();
  } @catch (...) {

  } @finally {

  }
  // Expected error about missing return
}

Clang still generates code as though there were, in fact, a return value for
the function.

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