// RUN: %clang_cc1 -fsyntax-only -pedantic -verify %s
// Simple form
int ar1;
// Element type cannot be:
// - (cv) void
volatile void ar2; // expected-error {{incomplete element type 'volatile void'}}
// - a reference
int& ar3; // expected-error {{array of references}}
// - a function type
typedef void ;
Fn ar4; // expected-error {{array of functions}}
// - an abstract class
; // expected-note {{pure virtual}}
Abstract ar5; // expected-error {{abstract class}}
// If we have a size, it must be greater than zero.
int ar6; // expected-error {{array with a negative size}}
int ar7; // expected-warning {{zero size arrays are an extension}}
// An array with unknown bound is incomplete.
int ar8; // expected-error {{needs an explicit size or an initializer}}
// So is an array with an incomplete element type.
; // expected-note {{forward declaration}}
Incomplete ar9; // expected-error {{incomplete type}}
// Neither of which should be a problem in situations where no complete type
// is required. (PR5048)
void ;
extern int ear1;
extern Incomplete ear2;
// cv migrates to element type
typedef const int cint;
extern cint car1;
typedef int intar;
// thus this is a valid redeclaration
extern const intar car1;
// Check that instantiation works properly when the element type is a template.
;
S<int> ar10; // expected-note {{requested here}}
// Ensure that negative array size errors include the name of the declared
// array as this is often used to simulate static_assert with template
// instantiations, placing the 'error message' in the declarator name.
int
; // expected-error {{user_error_message}}
typedef int
another_user_error_message
; // expected-error {{another_user_error_message}}