diff options
| -rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 25103441ac1..f91fb010a79 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -1658,8 +1658,7 @@ void CodeGenFunction::EmitAutoVarInit(const AutoVarEmission &emission) { // 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); |

