[PATCH] D17621: [clang-format] Detect constructor initializers preceded by `noexcept`.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 21:57:27 PST 2016


djasper added a comment.

Thanks for looking at this.

Please also add a test in unittests/Format/FormatTest.cpp.


================
Comment at: lib/Format/TokenAnnotator.cpp:507
@@ -506,3 +506,3 @@
                  !Line.First->isOneOf(tok::kw_enum, tok::kw_case)) {
-        if (Tok->Previous->is(tok::r_paren))
+        if (Tok->Previous->is(tok::r_paren) || Tok->Previous->is(tok::kw_noexcept))
           Tok->Type = TT_CtorInitializerColon;
----------------
Use Tok->Previous->isOneOf(tok::r_paren, tok_kw_noexcept)


http://reviews.llvm.org/D17621





More information about the cfe-commits mailing list