@@ -4803,12 +4803,13 @@ TEST_F(FormatTest, FormatsInlineASM) {
4803
4803
"int i;");
4804
4804
4805
4805
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));");
4812
4813
4813
4814
Style.BreakBeforeInlineASMColon = FormatStyle::BBIAS_OnlyMultiline;
4814
4815
verifyFormat(Code1, Style);
@@ -6704,16 +6705,16 @@ TEST_F(FormatTest, EscapedNewlines) {
6704
6705
" int x(int a);",
6705
6706
AlignLeft);
6706
6707
6707
- constexpr StringRef Code{ "#define A \\\n"
6708
+ constexpr StringRef Code( "#define A \\\n"
6708
6709
" int a123; \\\n"
6709
6710
" int a; \\\n"
6710
- " int a1234;"} ;
6711
+ " int a1234;") ;
6711
6712
verifyFormat(Code, AlignLeft);
6712
6713
6713
- constexpr StringRef Code2{ "#define A \\\n"
6714
+ constexpr StringRef Code2( "#define A \\\n"
6714
6715
" int a123; \\\n"
6715
6716
" int a; \\\n"
6716
- " int a1234;"} ;
6717
+ " int a1234;") ;
6717
6718
auto LastLine = getLLVMStyle();
6718
6719
LastLine.AlignEscapedNewlines = FormatStyle::ENAS_LeftWithLastLine;
6719
6720
verifyFormat(Code2, LastLine);
@@ -12108,9 +12109,9 @@ TEST_F(FormatTest, PointerAlignmentFallback) {
12108
12109
FormatStyle Style = getLLVMStyle();
12109
12110
Style.DerivePointerAlignment = true;
12110
12111
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;");
12114
12115
12115
12116
EXPECT_EQ(Style.PointerAlignment, FormatStyle::PAS_Right);
12116
12117
verifyFormat("int *p;\n"
@@ -15025,7 +15026,7 @@ TEST_F(FormatTest, PullTrivialFunctionDefinitionsIntoSingleLine) {
15025
15026
" aaaaaaaaaaaaaaaaaa,\n"
15026
15027
" aaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb) {}");
15027
15028
15028
- constexpr StringRef Code{ "void foo() { /* Empty */ }"} ;
15029
+ constexpr StringRef Code( "void foo() { /* Empty */ }") ;
15029
15030
verifyFormat(Code);
15030
15031
verifyFormat(Code, "void foo() { /* Empty */\n"
15031
15032
"}");
@@ -27255,7 +27256,7 @@ TEST_F(FormatTest, IndentAccessModifiers) {
27255
27256
27256
27257
TEST_F(FormatTest, LimitlessStringsAndComments) {
27257
27258
auto Style = getLLVMStyleWithColumns(0);
27258
- constexpr StringRef Code =
27259
+ constexpr StringRef Code(
27259
27260
"/**\n"
27260
27261
" * This is a multiline comment with quite some long lines, at least for "
27261
27262
"the LLVM Style.\n"
@@ -27276,7 +27277,7 @@ TEST_F(FormatTest, LimitlessStringsAndComments) {
27276
27277
" const std::string SmallString = \"Hello World\";\n"
27277
27278
" // Small line comment\n"
27278
27279
" return String.size() > SmallString.size();\n"
27279
- "}";
27280
+ "}") ;
27280
27281
verifyNoChange(Code, Style);
27281
27282
}
27282
27283
@@ -28400,9 +28401,9 @@ TEST_F(FormatTest, InsertNewlineAtEOF) {
28400
28401
verifyNoChange("int i;\n", Style);
28401
28402
verifyFormat("int i;\n", "int i;", Style);
28402
28403
28403
- constexpr StringRef Code{ "namespace {\n"
28404
+ constexpr StringRef Code( "namespace {\n"
28404
28405
"int i;\n"
28405
- "} // namespace"} ;
28406
+ "} // namespace") ;
28406
28407
verifyFormat(Code.str() + '\n', Code, Style,
28407
28408
{tooling::Range(19, 13)}); // line 3
28408
28409
}
@@ -28411,7 +28412,7 @@ TEST_F(FormatTest, KeepEmptyLinesAtEOF) {
28411
28412
FormatStyle Style = getLLVMStyle();
28412
28413
Style.KeepEmptyLines.AtEndOfFile = true;
28413
28414
28414
- const StringRef Code{ "int i;\n\n"} ;
28415
+ constexpr StringRef Code( "int i;\n\n") ;
28415
28416
verifyNoChange(Code, Style);
28416
28417
verifyFormat(Code, "int i;\n\n\n", Style);
28417
28418
}
@@ -28644,8 +28645,8 @@ TEST_F(FormatTest, PPDirectivesAndCommentsInBracedInit) {
28644
28645
}
28645
28646
28646
28647
TEST_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\";") ;
28649
28650
28650
28651
verifyFormat("return \"Code\"\n"
28651
28652
" \"\\0\\52\\26\\55\\55\\0\"\n"
@@ -29056,9 +29057,9 @@ TEST_F(FormatTest, KeepFormFeed) {
29056
29057
auto Style = getLLVMStyle();
29057
29058
Style.KeepFormFeed = true;
29058
29059
29059
- constexpr StringRef NoFormFeed{ "int i;\n"
29060
+ constexpr StringRef NoFormFeed( "int i;\n"
29060
29061
"\n"
29061
- "void f();"} ;
29062
+ "void f();") ;
29062
29063
verifyFormat(NoFormFeed,
29063
29064
"int i;\n"
29064
29065
" \f\n"
@@ -29080,9 +29081,9 @@ TEST_F(FormatTest, KeepFormFeed) {
29080
29081
"void f();\f",
29081
29082
Style);
29082
29083
29083
- constexpr StringRef FormFeed{ "int i;\n"
29084
+ constexpr StringRef FormFeed( "int i;\n"
29084
29085
"\f\n"
29085
- "void f();"} ;
29086
+ "void f();") ;
29086
29087
verifyNoChange(FormFeed, Style);
29087
29088
29088
29089
Style.LineEnding = FormatStyle::LE_LF;
@@ -29092,10 +29093,10 @@ TEST_F(FormatTest, KeepFormFeed) {
29092
29093
"void f();",
29093
29094
Style);
29094
29095
29095
- constexpr StringRef FormFeedBeforeEmptyLine{ "int i;\n"
29096
+ constexpr StringRef FormFeedBeforeEmptyLine( "int i;\n"
29096
29097
"\f\n"
29097
29098
"\n"
29098
- "void f();"} ;
29099
+ "void f();") ;
29099
29100
Style.MaxEmptyLinesToKeep = 2;
29100
29101
verifyFormat(FormFeedBeforeEmptyLine,
29101
29102
"int i;\n"
0 commit comments