[PATCH] D30932: [clang-format] disabled adding extra space after MSVC '__super' keyword

Martin Probst via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 16 03:33:53 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL297936: [clang-format] disable adding extra space after MSVC '__super' keyword (authored by mprobst).

Changed prior to commit:
  https://reviews.llvm.org/D30932?vs=91733&id=91982#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30932

Files:
  cfe/trunk/lib/Format/TokenAnnotator.cpp
  cfe/trunk/unittests/Format/FormatTest.cpp


Index: cfe/trunk/lib/Format/TokenAnnotator.cpp
===================================================================
--- cfe/trunk/lib/Format/TokenAnnotator.cpp
+++ cfe/trunk/lib/Format/TokenAnnotator.cpp
@@ -2382,7 +2382,7 @@
     return (Left.is(TT_TemplateOpener) &&
             Style.Standard == FormatStyle::LS_Cpp03) ||
            !(Left.isOneOf(tok::l_paren, tok::r_paren, tok::l_square,
-                          TT_TemplateCloser, TT_TemplateOpener));
+                          tok::kw___super, TT_TemplateCloser, TT_TemplateOpener));
   if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser)))
     return Style.SpacesInAngles;
   if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) ||
Index: cfe/trunk/unittests/Format/FormatTest.cpp
===================================================================
--- cfe/trunk/unittests/Format/FormatTest.cpp
+++ cfe/trunk/unittests/Format/FormatTest.cpp
@@ -9977,6 +9977,10 @@
             format("auto a = unique_ptr < Foo < Bar>[10]> ;", Spaces));
 }
 
+TEST_F(FormatTest, NoSpaceAfterSuper) {
+    verifyFormat("__super::FooBar();");
+}
+
 TEST(FormatStyle, GetStyleOfFile) {
   vfs::InMemoryFileSystem FS;
   // Test 1: format file in the same directory.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30932.91982.patch
Type: text/x-patch
Size: 1230 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170316/2e480b28/attachment.bin>


More information about the cfe-commits mailing list