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.


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.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D30932: [cla... Juliusz Toczydłowski via Phabricator via cfe-commits
    • [PATCH] D30932:... Martin Probst via Phabricator via cfe-commits
    • [PATCH] D30932:... Martin Probst via Phabricator via cfe-commits

Reply via email to