Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjC: Method unavailability attribute doesn't work with overloaded methods #22421

Closed
nico opened this issue Dec 28, 2014 · 2 comments
Closed
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@nico
Copy link
Contributor

nico commented Dec 28, 2014

Bugzilla Link 22047
Resolution FIXED
Resolved on Apr 28, 2015 13:06
Version trunk
OS All

Extended Description

@​interface Face1

  • (void)foo:(int)i attribute((unavailable));
    @​end
    @​interface Face0
  • (void)foo:(float)i;
    @​end

void f(id i) {
[i foo:4.0f];
}

$ bin/clang -c test.m
test.m:9:6: error: 'foo:' is unavailable
[i foo:4.0f];
^
test.m:2:1: note: 'foo:' has been explicitly marked unavailable here

  • (void)foo:(int)i attribute((unavailable));
    ^

This is incorrect, the float version of foo: is available. This is because the warning only looks at the first overload.

If the order of Face1 and Face0 is swapped, the warning goes away.

@nico
Copy link
Contributor Author

nico commented Dec 28, 2014

Overloaded selectors are rare, but llvm tries to be high-quality about rare things too.

@llvmbot
Copy link
Collaborator

llvmbot commented Apr 28, 2015

Fixed in r236006.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants