llvm-project/clang/test/FixIt
Anders Carlsson ace5d07e50 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.

llvm-svn: 86665
2009-11-10 04:46:30 +00:00
..
fixit-at.c Update test case; I'm confused why this wasn't failing on the buildbot 2009-05-16 19:30:01 +00:00
fixit-c90.c Move the fix-it tests into their own subdirectory 2009-04-02 17:19:13 +00:00
fixit-errors-1.c Move the rest of the fixit tests to the FixIt area. 2009-04-02 23:44:32 +00:00
fixit-errors.c Rework the fix-it hint for code like 2009-11-06 06:30:47 +00:00
fixit-objc.m 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: 2009-11-10 04:46:30 +00:00
fixit-pmem.cpp Add 'fixit' hint on mis-use of pointer-to-member 2009-10-26 20:45:27 +00:00
fixit.c Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris! 2009-04-06 18:45:53 +00:00
fixit.cpp 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. 2009-11-10 03:24:44 +00:00