Index: clang/lib/Format/TokenAnnotator.cpp =================================================================== --- clang/lib/Format/TokenAnnotator.cpp +++ clang/lib/Format/TokenAnnotator.cpp @@ -2852,6 +2852,8 @@ return false; } else if (isCppAttribute(IsCpp, *Next)) { Next = Next->MatchingParen; + if (!Next) + return false; } else if (Next->is(tok::l_paren)) { break; } else {