whether it's POD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201018
91177308-0d34-0410-b5e6-
96231b3b80d8
// Prohibit the use of non-POD types in VLAs.
QualType BaseT = Context.getBaseElementType(T);
if (!T->isDependentType() &&
+ !RequireCompleteType(Loc, BaseT, 0) &&
!BaseT.isPODType(Context) &&
!BaseT->isObjCLifetimeType()) {
Diag(Loc, diag::err_vla_non_pod)
// PR11925
int n;
int (&f())[n]; // expected-error {{function declaration cannot have variably modified type}}
+
+namespace PR18581 {
+ template<typename T> struct pod {};
+ template<typename T> struct error {
+ typename T::error e; // expected-error {{cannot be used prior to '::'}}
+ };
+ struct incomplete; // expected-note {{forward declaration}}
+
+ void f(int n) {
+ pod<int> a[n];
+ error<int> b[n]; // expected-note {{instantiation}}
+ incomplete c[n]; // expected-error {{incomplete}}
+ }
+}