As suggested by @rjmccall in D57797.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353490
91177308-0d34-0410-b5e6-
96231b3b80d8
// Technically zero-sized or negative-sized VLAs are undefined, and UBSan
// will catch that code, but there exists code which generates zero-sized
// VLAs. Be nice and initialize whatever they requested.
- const VariableArrayType *VlaType =
- dyn_cast_or_null<VariableArrayType>(getContext().getAsArrayType(type));
+ const auto *VlaType = getContext().getAsVariableArrayType(type);
if (!VlaType)
return;
auto VlaSize = getVLASize(VlaType);