@@ -4803,12 +4803,13 @@ TEST_F(FormatTest, FormatsInlineASM) {
48034803 "int i;");
48044804
48054805 auto Style = getLLVMStyleWithColumns(0);
4806- const StringRef Code1{"asm(\"xyz\" : \"=a\"(a), \"=d\"(b) : \"a\"(data));"};
4807- const StringRef Code2{"asm(\"xyz\"\n"
4808- " : \"=a\"(a), \"=d\"(b)\n"
4809- " : \"a\"(data));"};
4810- const StringRef Code3{"asm(\"xyz\" : \"=a\"(a), \"=d\"(b)\n"
4811- " : \"a\"(data));"};
4806+ constexpr StringRef Code1(
4807+ "asm(\"xyz\" : \"=a\"(a), \"=d\"(b) : \"a\"(data));");
4808+ constexpr StringRef Code2("asm(\"xyz\"\n"
4809+ " : \"=a\"(a), \"=d\"(b)\n"
4810+ " : \"a\"(data));");
4811+ constexpr StringRef Code3("asm(\"xyz\" : \"=a\"(a), \"=d\"(b)\n"
4812+ " : \"a\"(data));");
48124813
48134814 Style.BreakBeforeInlineASMColon = FormatStyle::BBIAS_OnlyMultiline;
48144815 verifyFormat(Code1, Style);
@@ -6704,16 +6705,16 @@ TEST_F(FormatTest, EscapedNewlines) {
67046705 " int x(int a);",
67056706 AlignLeft);
67066707
6707- constexpr StringRef Code{ "#define A \\\n"
6708+ constexpr StringRef Code( "#define A \\\n"
67086709 " int a123; \\\n"
67096710 " int a; \\\n"
6710- " int a1234;"} ;
6711+ " int a1234;") ;
67116712 verifyFormat(Code, AlignLeft);
67126713
6713- constexpr StringRef Code2{ "#define A \\\n"
6714+ constexpr StringRef Code2( "#define A \\\n"
67146715 " int a123; \\\n"
67156716 " int a; \\\n"
6716- " int a1234;"} ;
6717+ " int a1234;") ;
67176718 auto LastLine = getLLVMStyle();
67186719 LastLine.AlignEscapedNewlines = FormatStyle::ENAS_LeftWithLastLine;
67196720 verifyFormat(Code2, LastLine);
@@ -12108,9 +12109,9 @@ TEST_F(FormatTest, PointerAlignmentFallback) {
1210812109 FormatStyle Style = getLLVMStyle();
1210912110 Style.DerivePointerAlignment = true;
1211012111
12111- const StringRef Code("int* p;\n"
12112- "int *q;\n"
12113- "int * r;");
12112+ constexpr StringRef Code("int* p;\n"
12113+ "int *q;\n"
12114+ "int * r;");
1211412115
1211512116 EXPECT_EQ(Style.PointerAlignment, FormatStyle::PAS_Right);
1211612117 verifyFormat("int *p;\n"
@@ -15025,7 +15026,7 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {
1502515026 " aaaaaaaaaaaaaaaaaa,\n"
1502615027 " aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) {}");
1502715028
15028- constexpr StringRef Code{ "void foo() { /* Empty */ }"} ;
15029+ constexpr StringRef Code( "void foo() { /* Empty */ }") ;
1502915030 verifyFormat(Code);
1503015031 verifyFormat(Code, "void foo() { /* Empty */\n"
1503115032 "}");
@@ -27255,7 +27256,7 @@ TEST_F(FormatTest, IndentAccessModifiers) {
2725527256
2725627257TEST_F(FormatTest, LimitlessStringsAndComments) {
2725727258 auto Style = getLLVMStyleWithColumns(0);
27258- constexpr StringRef Code =
27259+ constexpr StringRef Code(
2725927260 "/**\n"
2726027261 " * This is a multiline comment with quite some long lines, at least for "
2726127262 "the LLVM Style.\n"
@@ -27276,7 +27277,7 @@ TEST_F(FormatTest, LimitlessStringsAndComments) {
2727627277 " const std::string SmallString = \"Hello World\";\n"
2727727278 " // Small line comment\n"
2727827279 " return String.size() > SmallString.size();\n"
27279- "}";
27280+ "}") ;
2728027281 verifyNoChange(Code, Style);
2728127282}
2728227283
@@ -28400,9 +28401,9 @@ TEST_F(FormatTest, InsertNewlineAtEOF) {
2840028401 verifyNoChange("int i;\n", Style);
2840128402 verifyFormat("int i;\n", "int i;", Style);
2840228403
28403- constexpr StringRef Code{ "namespace {\n"
28404+ constexpr StringRef Code( "namespace {\n"
2840428405 "int i;\n"
28405- "} // namespace"} ;
28406+ "} // namespace") ;
2840628407 verifyFormat(Code.str() + '\n', Code, Style,
2840728408 {tooling::Range(19, 13)}); // line 3
2840828409}
@@ -28411,7 +28412,7 @@ TEST_F(FormatTest, KeepEmptyLinesAtEOF) {
2841128412 FormatStyle Style = getLLVMStyle();
2841228413 Style.KeepEmptyLines.AtEndOfFile = true;
2841328414
28414- const StringRef Code{ "int i;\n\n"} ;
28415+ constexpr StringRef Code( "int i;\n\n") ;
2841528416 verifyNoChange(Code, Style);
2841628417 verifyFormat(Code, "int i;\n\n\n", Style);
2841728418}
@@ -28644,8 +28645,8 @@ TEST_F(FormatTest, PPDirectivesAndCommentsInBracedInit) {
2864428645}
2864528646
2864628647TEST_F(FormatTest, BreakAdjacentStringLiterals) {
28647- constexpr StringRef Code{
28648- "return \"Code\" \"\\0\\52\\26\\55\\55\\0\" \"x013\" \"\\02\\xBA\";"} ;
28648+ constexpr StringRef Code(
28649+ "return \"Code\" \"\\0\\52\\26\\55\\55\\0\" \"x013\" \"\\02\\xBA\";") ;
2864928650
2865028651 verifyFormat("return \"Code\"\n"
2865128652 " \"\\0\\52\\26\\55\\55\\0\"\n"
@@ -29056,9 +29057,9 @@ TEST_F(FormatTest, KeepFormFeed) {
2905629057 auto Style = getLLVMStyle();
2905729058 Style.KeepFormFeed = true;
2905829059
29059- constexpr StringRef NoFormFeed{ "int i;\n"
29060+ constexpr StringRef NoFormFeed( "int i;\n"
2906029061 "\n"
29061- "void f();"} ;
29062+ "void f();") ;
2906229063 verifyFormat(NoFormFeed,
2906329064 "int i;\n"
2906429065 " \f\n"
@@ -29080,9 +29081,9 @@ TEST_F(FormatTest, KeepFormFeed) {
2908029081 "void f();\f",
2908129082 Style);
2908229083
29083- constexpr StringRef FormFeed{ "int i;\n"
29084+ constexpr StringRef FormFeed( "int i;\n"
2908429085 "\f\n"
29085- "void f();"} ;
29086+ "void f();") ;
2908629087 verifyNoChange(FormFeed, Style);
2908729088
2908829089 Style.LineEnding = FormatStyle::LE_LF;
@@ -29092,10 +29093,10 @@ TEST_F(FormatTest, KeepFormFeed) {
2909229093 "void f();",
2909329094 Style);
2909429095
29095- constexpr StringRef FormFeedBeforeEmptyLine{ "int i;\n"
29096+ constexpr StringRef FormFeedBeforeEmptyLine( "int i;\n"
2909629097 "\f\n"
2909729098 "\n"
29098- "void f();"} ;
29099+ "void f();") ;
2909929100 Style.MaxEmptyLinesToKeep = 2;
2910029101 verifyFormat(FormFeedBeforeEmptyLine,
2910129102 "int i;\n"
0 commit comments