p4.cpp revision be1aa410274b28fc143c47c814f07c989f4534d6
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -pedantic -Werror  %s
2int a1[] = { 1, 3, 5 };
3void f() {
4  int a2[] = { 1, 3, 5 };
5}
6template <typename T>
7void tf() {
8  T t;
9  // Element type may be dependent
10  T a3[] = { 1, 3, 5 };
11  // As might be the initializer list, value
12  int a5[] = { sizeof(T) };
13  // or even type.
14  int a6[] = { t.get() };
15}
16
17// Allowed by GNU extension
18int a4[] = {}; // expected-error {{zero size arrays}}
19