[PATCH] D21204: clang-format: [JS] post-fix non-null assertion operator.

Martin Probst via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 9 22:23:50 PDT 2016


mprobst added inline comments.

================
Comment at: lib/Format/TokenAnnotator.cpp:2128
@@ +2127,3 @@
+    if (Right.is(tok::exclaim) && (Left.isOneOf(tok::identifier, tok::r_paren,
+                                                tok::r_square, tok::r_brace) ||
+                                   Left.Tok.isLiteral()))
----------------
Tests added. A literal cannot really be null, but the operator is allowed after any kind of expression, and it's straight forward to test for it here.


http://reviews.llvm.org/D21204





More information about the cfe-commits mailing list