Revision 9d2cca71cf54ddfebda26e247d82ae7b71d9e03c authored by Pranav Gokhale on 30 June 2018, 18:56:21 UTC, committed by Pranav Gokhale on 30 June 2018, 18:56:21 UTC
1 parent 720b0db
Raw File
decl-invalid.c
// RUN: %clang_cc1 %s -fsyntax-only -verify

// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
typedef union <anonymous> __mbstate_t;  // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{declaration does not declare anything}}


// PR2017
void x(); 
int a() {
  int r[x()];  // expected-error {{size of array has non-integer type 'void'}}

  static y ?; // expected-error{{unknown type name 'y'}} \
                 expected-error{{expected identifier or '('}}
}

int; // expected-warning {{declaration does not declare anything}}
typedef int; // expected-warning {{declaration does not declare anything}}
const int; // expected-warning {{declaration does not declare anything}}
struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
typedef int I;
I; // expected-warning {{declaration does not declare anything}}



// rdar://6880449
register int test1;     // expected-error {{illegal storage class on file-scoped variable}}
register int test2 __asm__("edi");  // expected-error {{global register variables are not supported}}

back to top