[llvm-bugs] [Bug 32701] New: Objective-C: no warning if calling known selector on a forward declared @class.

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 18 05:31:02 PDT 2017


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

            Bug ID: 32701
           Summary: Objective-C: no warning if calling known selector on a
                    forward declared @class.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sdefresne at google.com
                CC: llvm-bugs at lists.llvm.org

Compiling the following code fragment with clang version "Apple LLVM version
8.0.0 (clang-800.0.42.1)" or "clang version 5.0.0 (trunk 298539)" should emit a
warning that class Foo does not respond to selector -baz:

==== foo.m ====
@class Foo;
@protocol Bar
- (void)baz;
@end
void DoSomething(Foo* f) {
  [f baz];
}
==== foo.m ====

$ clang++ -o foo.o foo.mm -c -W -Wextra -Wselector -Wselector-type-mismatch
-Wstrict-selector-match -Wundeclared-selector -Wmissing-selector-name
$

EXPECTED RESULT: a warning should be printed that Foo may not respond to -baz
selector as happens when the Bar protocol is not existent.

-- 
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/20170418/a9771a0f/attachment.html>


More information about the llvm-bugs mailing list