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

Erik Kessler via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 11:37:48 PST 2016


erik65536 created this revision.
erik65536 added reviewers: djasper, klimek.
erik65536 added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

http://reviews.llvm.org/D17621

Files:
  lib/Format/TokenAnnotator.cpp

Index: lib/Format/TokenAnnotator.cpp
===================================================================
--- lib/Format/TokenAnnotator.cpp
+++ lib/Format/TokenAnnotator.cpp
@@ -504,7 +504,7 @@
         Tok->Type = TT_BitFieldColon;
       } else if (Contexts.size() == 1 &&
                  !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;
         else
           Tok->Type = TT_InheritanceColon;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17621.49100.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160225/412c0e50/attachment.bin>


More information about the cfe-commits mailing list