http://llvm.org/bugs/show_bug.cgi?id=10905
Summary: Drop fixits that don't compile cleanly
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
thakis-macbookpro:src thakis$ cat test.mm
#import <Cocoa/Cocoa.h>
@interface A : NSObject
- (void)setRect:(NSRect)r;
@end
void f(A* a) {
NSRect rect;
[a setRect:frameRect]; // Meant: |rect|
}
# GCC is short and to the point
thakis-macbookpro:src thakis$ gcc -c test.mm
test.mm: In function ‘void f(A*)’:
test.mm:9: error: ‘frameRect’ was not declared in this scope
# Clang not so much:
thakis-macbookpro:src thakis$ third_party/llvm-build/Release+Asserts/bin/clang
-c test.mm
test.mm:9:14: error: use of undeclared identifier 'frameRect'; did you mean
'NSFrameRect'?
[a setRect:frameRect];
^~~~~~~~~
NSFrameRect
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:148:20: note:
'NSFrameRect' declared here
APPKIT_EXTERN void NSFrameRect(NSRect aRect);
^
test.mm:9:14: error: no viable conversion from 'void (NSRect)' to 'NSRect' (aka
'CGRect')
[a setRect:frameRect];
^~~~~~~~~
/System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:29:8:
note: candidate constructor (the implicit copy constructor) not viable: no
known conversion from 'void (NSRect)' to
'const CGRect &' for 1st argument;
struct CGRect {
^
test.mm:4:25: note: passing argument to parameter 'r' here
- (void)setRect:(NSRect)r;
^
2 errors generated.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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