sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land.
Thanks! ================ Comment at: lib/Format/UnwrappedLineFormatter.cpp:486 return 0; + if (Line.First->is(tok::kw_default)) { + const FormatToken *Tok = Line.First->getNextNonComment(); ---------------- Just to check my understanding... we want to treat `default` the same as `case`, but the heuristics are different: - `case` should only appear in a switch (but might be followed by a complex expression) - `default` has lots of meanings (but we can disambiguate: check if it's followed by a colon) You could consider `// default: in switch statement` above this line. ================ Comment at: unittests/Format/FormatTest.cpp:1012 + "{\n" + "case 0: {\n" + " return false;\n" ---------------- the intent of this test might be clearer if the cases were formatted as `case 0: { return false; }` on one line Repository: rC Clang https://reviews.llvm.org/D51294 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits