1a5728872c7702ddd09537c95bc3cbd20e1f2fb09Daniel Dunbar// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -pedantic -Werror %s 2d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redlint a1[] = { 1, 3, 5 }; 3d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redlvoid f() { 4d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl int a2[] = { 1, 3, 5 }; 5d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl} 6d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redltemplate <typename T> 7d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redlvoid tf() { 8d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl T t; 9d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl // Element type may be dependent 10d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl T a3[] = { 1, 3, 5 }; 11d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl // As might be the initializer list, value 12d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl int a5[] = { sizeof(T) }; 13d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl // or even type. 14d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl int a6[] = { t.get() }; 15d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl} 16d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl 17d75191f0d100b596281f99ea8f2f0a0d0560d969Sebastian Redl// Allowed by GNU extension 18be1aa410274b28fc143c47c814f07c989f4534d6Daniel Dunbarint a4[] = {}; // expected-error {{zero size arrays}} 1972ab27732ea7a42d756a1e79727f86fbe391b42bRichard Smith 2072ab27732ea7a42d756a1e79727f86fbe391b42bRichard Smithstruct Incomplete; // expected-note {{forward declaration of 'Incomplete'}} 2172ab27732ea7a42d756a1e79727f86fbe391b42bRichard Smithstruct A { 2272ab27732ea7a42d756a1e79727f86fbe391b42bRichard Smith Incomplete i; // expected-error {{field has incomplete type 'Incomplete'}} 2372ab27732ea7a42d756a1e79727f86fbe391b42bRichard Smith}; 2472ab27732ea7a42d756a1e79727f86fbe391b42bRichard SmithA a[] = { 0 }; // PR13971: don't hang. 25