djasper added inline comments.
================ Comment at: lib/Format/UnwrappedLineParser.cpp:489 - nextToken(); // Munch the closing brace. + nextToken(InitialLevel); // Munch the closing brace. ---------------- What happens if you instead change the Line->Level = InitialLevel; statement from below to before this line? That seems like the more intuitively correct fix. ================ Comment at: lib/Format/UnwrappedLineParser.cpp:2378 ScopedLineState BlockState(*this, SwitchToPreprocessorLines); + if (InitialLevel) Line->Level = *InitialLevel; // Comments stored before the preprocessor directive need to be output ---------------- LLVM style requires a line break. ================ Comment at: unittests/Format/FormatTestComments.cpp:848 + "}", + format("int f(int i) {\n" + " if (true) {\n" ---------------- Generally, mess up the code in some way to ensure that it is actually being formatted. https://reviews.llvm.org/D35485 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits