Anders Carlsson
b76cd3d0c1
When trying to assign a regular string literal to an Objective-C 'id' type or a pointer to an NSString, emit a code insertion hint that turns it into an Objective-C string. For example:
...
@class NSString;
@interface Test
+ (void)test:(NSString *)string;
@end
void g(NSString *a);
void f() {
NSString *a = "Foo";
g("Foo");
[Test test:"Foo"];
}
will produce
t.m:10:17: warning: incompatible pointer types initializing 'char [4]', expected 'NSString *'
NSString *a = "Foo";
^~~~~
@
t.m:11:5: warning: incompatible pointer types passing 'char [4]', expected 'NSString *'
g("Foo");
^~~~~
@
t.m:12:14: warning: incompatible pointer types sending 'char [4]', expected 'NSString *'
[Test test:"Foo"];
^~~~~
@
3 diagnostics generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 04:46:30 +00:00
Anders Carlsson
ad26b7376b
If a function with a default argument is redefined and the new function also has a defualt argument then add a fixit hint that removes the default argument. Fixes PR5444.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 03:24:44 +00:00
Daniel Dunbar
4fcfde4d5c
Eliminate &&s in tests.
...
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08 01:45:36 +00:00
Douglas Gregor
3f0b5fd3a5
Rework the fix-it hint for code like
...
get_origin->x
where get_origin is actually a function and the user has forgotten the
parentheses. Instead of giving a lame note for the fix-it, give a
full-fledge error, early, then build the call expression to try to
recover.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 06:30:47 +00:00
Fariborz Jahanian
ef78ac6013
Add 'fixit' hint on mis-use of pointer-to-member
...
binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 20:45:27 +00:00
Daniel Dunbar
8ae0639ac2
Update test case; I'm confused why this wasn't failing on the buildbot
...
though?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-16 19:30:01 +00:00
Douglas Gregor
a86b832906
Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06 18:45:53 +00:00
Chris Lattner
75e3606728
add fixit advice to an archiac ObjC issue.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03 18:38:42 +00:00
Mike Stump
81048aa3e5
Move the rest of the fixit tests to the FixIt area.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 23:44:32 +00:00
Douglas Gregor
26df2f0958
Add a new command-line option "-fixit-at=file:line:column" that only
...
applies fix-its to error messages that occur at that specific location
in the program.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 19:05:20 +00:00
Douglas Gregor
dd6f4abe81
Move the fix-it tests into their own subdirectory
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02 17:19:13 +00:00