clang-format treats MSVC `__super` keyword like all other keywords adding
a single space after. This change disables this behavior for `__super`.
Patch originally by jutocz (thanks!).
Differential Revision: https://reviews.llvm.org/D30932
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297936
91177308-0d34-0410-b5e6-
96231b3b80d8
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)) ||
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.