A [*] is only allowed in a declaration for a function, not in its
definition. We didn't correctly recurse on reference types while
looking for it, causing us to crash in CodeGen instead of rejecting it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234528
91177308-0d34-0410-b5e6-
96231b3b80d8
diagnoseArrayStarInParamType(S, PointerTy->getPointeeType(), Loc);
return;
}
+ if (const auto *ReferenceTy = dyn_cast<ReferenceType>(PType)) {
+ diagnoseArrayStarInParamType(S, ReferenceTy->getPointeeType(), Loc);
+ return;
+ }
if (const auto *ParenTy = dyn_cast<ParenType>(PType)) {
diagnoseArrayStarInParamType(S, ParenTy->getInnerType(), Loc);
return;
incomplete c[n]; // expected-error {{incomplete}}
}
}
+
+void pr23151(int (&)[*]) { // expected-error {{variable length array must be bound in function definition}}
+}