gcc incompatiblity when using joined NSStrings/CFStrings

Hi,

     s0539:src nico$ cat test.m
     #include <Foundation/Foundation.h>

     int main()
     {
       NSLog(@"%@", @"a "
           "b");
       NSLog(@"%@", @"a "
           @"b");
       NSLog(@"%@", "a "
           @"b");
     }

     s0539:src nico$ gcc test.m -framework Foundation
     s0539:src nico$ ./a.out
     2007-12-18 13:26:23.077 a.out[26199:10b] a b
     2007-12-18 13:26:23.079 a.out[26199:10b] a b
     s0539:src nico$ ./clang test.m
     running "/Users/nico/src/llvm-svn/Debug/bin/clang -fsyntax-only test.m"
     test.m:10:7: error: expected ')'
           @"b");
           ^
     test.m:9:8: error: to match this '('
       NSLog(@"%@", "a "
            ^
     test.m:9:3: warning: expression result unused
       NSLog(@"%@", "a "
       ^~~~~
     3 diagnostics generated.

Nico

Here's a more elaborate testcase that compiles without warnings on gcc (and gives some compiler errors with clang):

#include <Foundation/Foundation.h>

int main()
{
   char *c;
   wchar_t *w;
   NSString *s;

   c = "hi";
   w = L"hi";
   s = @"Hi";
   s = @L"hi";
   //L@"hi"; // expected-error{{use of undeclared idenifier 'L'}}

   w = L"hi" "hi" "hi";
   w = "hi" L"hi" "hi";
   w = "hi" "hi" L"hi";

   s = @"hi" "hi" "hi";
   s = "hi" @"hi" "hi";
   s = "hi" "hi" @"hi";

   s = @"hi" L"hi" "hi";
   s = "hi" @"hi" L"hi";
   s = L"hi" "hi" @"hi";

   s = L"hi" @"hi" "hi";
   s = "hi" L"hi" @"hi";
   s = @"hi" "hi" L"hi";

   return 0;
}

Concatenating objc strings and "normal" strings is not really defined anywhere as far as I can tell, but it works in gcc.

Nico