Index: clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp +++ clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp @@ -60,6 +60,8 @@ const ASTContext &Context = *Result.Context; const SourceManager &Source = Context.getSourceManager(); + if (MatchedDecl->isInvalidDecl()) + return; // We want to warn about cases where the type name // comes from a macro like this: //