Index: clang-tidy/modernize/UseAutoCheck.cpp =================================================================== --- clang-tidy/modernize/UseAutoCheck.cpp +++ clang-tidy/modernize/UseAutoCheck.cpp @@ -298,7 +298,7 @@ } void UseAutoCheck::replaceNew(const DeclStmt *D, ASTContext *Context) { - const auto *FirstDecl = cast(*D->decl_begin()); + const auto *FirstDecl = dyn_cast(*D->decl_begin()); // Ensure that there is at least one VarDecl within the DeclStmt. if (!FirstDecl) return; Index: test/clang-tidy/modernize-use-auto-new.cpp =================================================================== --- test/clang-tidy/modernize-use-auto-new.cpp +++ test/clang-tidy/modernize-use-auto-new.cpp @@ -37,6 +37,8 @@ // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use auto when initializing with new // CHECK-FIXES: auto volatile vol = new MyType(); + struct SType {} *stype = new SType; + int (**func)(int, int) = new (int(*[5])(int,int)); int *array = new int[5];