[cfe-commits] r45489 - in /cfe/trunk: Parse/ParseObjc.cpp test/Parser/objc-messaging-neg-1.m

Nico Weber nicolasweber at gmx.de
Thu Jan 3 04:40:55 PST 2008


> Prevent crash on incorrect objc messaging expression.
>
> +// RUN: clang -fsyntax-only -verify %s
> +
> +int main()
> +   {
> +     id a;
> +     [a bla:0 6:7]; // expected-error {{expected ']'}}
> +   }

Better. But still a bit strange. Consider this test case:

@interface Bla
{
}

- (id):(int)i with:(NSString *)s : (int)j;

@end

int main()
{
   Bla* bla;
   [bla:4  with: @"bla" 0:0];
}

This gives the expected error from above. However,

@interface Bla
{
}

- (id):(int)i with:(NSString *)s : (int)j;

@end

int main()
{
   Bla* bla;
   [bla:4  with: @"bla" @"bla":0];
}

does not give any error or warning (the only difference is that I  
replaced `0:0` with `@"bla":0`). I guess it should produce the same  
error as the first program.

Nico



More information about the cfe-commits mailing list