http://llvm.org/bugs/show_bug.cgi?id=15931
Bug ID: 15931
Summary: Poisoning Objective-C methods
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Summary: Clang inherits the "poison" pragma from GCC. Unfortunately it doesn't
support poisoning Objective-C selectors very well.
Steps to reproduce: compile this code.
#import <Foundation/Foundation.h>
#pragma GCC poison initWithCString:
int main(int argc, char *argv[]) {
@autoreleasepool {
NSString *foo = [[NSString alloc] initWithCString:"foo"
encoding:NSUTF8StringEncoding];
NSLog(@"%@", foo);
}
}
Expected results: that should work. I've poisoned "initWithCString:" but used
"initWithCString:encoding:".
Actual results: two errors are emitted.
Untitled.m:2:35: error: can only poison identifier tokens
#pragma GCC poison initWithCString:
^
Untitled.m:6:37: error: attempt to use a poisoned identifier
NSString *foo = [[NSString alloc] initWithCString:"foo"
encoding:NSUTF8StringEncoding];
^
2 errors generated.
Notes: whether it's a separate pragma or not, I would like to enforce
Objective-C code guidelines by poisoning specific selectors. That shouldn't
poison other selectors that happen to contain my poisoned selectors in
substrings.
--
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