Please use unittests/Format/FormatTest.cpp for the unit test.
================ Comment at: lib/Format/Format.cpp:1125-1127 @@ -1124,4 +1124,5 @@ - if (std::find(ForEachMacros.begin(), ForEachMacros.end(), - FormatTok->Tok.getIdentifierInfo()) != ForEachMacros.end()) - FormatTok->Type = TT_ForEachMacro; + if (!(Tokens.size() > 0 && Tokens.back()->Tok.getIdentifierInfo() && + Tokens.back()->Tok.getIdentifierInfo()->getPPKeywordID() == + tok::pp_define)) + if (std::find(ForEachMacros.begin(), ForEachMacros.end(), ---------------- Generally use clang-format. Also, why are you using two nested if conditions instead of just merging this into the other one? http://reviews.llvm.org/D10266 EMAIL PREFERENCES http://reviews.llvm.org/settings/panel/emailpreferences/ _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
