Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 %s -fsyntax-only -verify
      2 typedef const struct __CFString * CFStringRef;
      3 #define CFSTR __builtin___CFStringMakeConstantString
      4 
      5 void f() {
      6   (void)CFStringRef(CFSTR("Hello"));
      7 }
      8 
      9 void a() { __builtin_va_list x, y; ::__builtin_va_copy(x, y); }
     10 
     11 // <rdar://problem/10063539>
     12 template<int (*Compare)(const char *s1, const char *s2)>
     13 int equal(const char *s1, const char *s2) {
     14   return Compare(s1, s2) == 0;
     15 }
     16 // FIXME: Our error recovery here sucks
     17 template int equal<&__builtin_strcmp>(const char*, const char*); // expected-error {{builtin functions must be directly called}} expected-error {{expected unqualified-id}} expected-error {{expected ')'}} expected-note {{to match this '('}}
     18 
     19 // PR13195
     20 void f2() {
     21   __builtin_isnan; // expected-error {{builtin functions must be directly called}}
     22 }
     23 
     24 // pr14895
     25 typedef __typeof(sizeof(int)) size_t;
     26 extern "C" void *__builtin_alloca (size_t);
     27