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

            Bug ID: 16287
           Summary: clang should give a better diagnostic for forgetting
                    the @ in front of an NSString
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Currently:

Nicos-MacBook-Pro:src thakis$ cat test.mm
#import <Cocoa/Cocoa.h>

@interface A
- (void)doFoo:(NSString*)s;
@end

void f(A* a) {
  [a doFoo:"asdf"];
}
Nicos-MacBook-Pro:src thakis$ ~/src/llvm/Release+Asserts/bin/clang -c test.mm
test.mm:8:12: error: cannot initialize a parameter of type 'NSString *' with an
lvalue of type 'const char [5]'
  [a doFoo:"asdf"];
           ^~~~~~
test.mm:4:26: note: passing argument to parameter 's' here
- (void)doFoo:(NSString*)s;
                         ^
1 error generated.


Instead it should just say `missing '@' in front of "asdf"`.

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