@@ -8571,10 +8571,10 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
8571
8571
"operator<<(const SomeLooooooooooooooooooooooooogType &other);");
8572
8572
verifyGoogleFormat(
8573
8573
"SomeLoooooooooooooooooooooooooooooogType operator>>(\n"
8574
- " const SomeLooooooooogType & a, const SomeLooooooooogType & b);");
8574
+ " const SomeLooooooooogType& a, const SomeLooooooooogType& b);");
8575
8575
verifyGoogleFormat(
8576
8576
"SomeLoooooooooooooooooooooooooooooogType operator<<(\n"
8577
- " const SomeLooooooooogType & a, const SomeLooooooooogType & b);");
8577
+ " const SomeLooooooooogType& a, const SomeLooooooooogType& b);");
8578
8578
8579
8579
verifyFormat("void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
8580
8580
" int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1);");
@@ -8583,7 +8583,7 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
8583
8583
verifyGoogleFormat(
8584
8584
"typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa\n"
8585
8585
"aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
8586
- " bool * aaaaaaaaaaaaaaaaaa, bool * aa) {}");
8586
+ " bool* aaaaaaaaaaaaaaaaaa, bool* aa) {}");
8587
8587
verifyGoogleFormat("template <typename T>\n"
8588
8588
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
8589
8589
"aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(\n"
@@ -12891,27 +12891,31 @@ TEST_F(FormatTest, UnderstandsEllipsis) {
12891
12891
}
12892
12892
12893
12893
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
12894
+ auto Style = getGoogleStyle();
12895
+ EXPECT_FALSE(Style.DerivePointerAlignment);
12896
+ Style.DerivePointerAlignment = true;
12897
+
12894
12898
verifyFormat("int *a;\n"
12895
12899
"int *a;\n"
12896
12900
"int *a;",
12897
12901
"int *a;\n"
12898
12902
"int* a;\n"
12899
12903
"int *a;",
12900
- getGoogleStyle() );
12904
+ Style );
12901
12905
verifyFormat("int* a;\n"
12902
12906
"int* a;\n"
12903
12907
"int* a;",
12904
12908
"int* a;\n"
12905
12909
"int* a;\n"
12906
12910
"int *a;",
12907
- getGoogleStyle() );
12911
+ Style );
12908
12912
verifyFormat("int *a;\n"
12909
12913
"int *a;\n"
12910
12914
"int *a;",
12911
12915
"int *a;\n"
12912
12916
"int * a;\n"
12913
12917
"int * a;",
12914
- getGoogleStyle() );
12918
+ Style );
12915
12919
verifyFormat("auto x = [] {\n"
12916
12920
" int *a;\n"
12917
12921
" int *a;\n"
@@ -12920,7 +12924,7 @@ TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
12920
12924
"auto x=[]{int *a;\n"
12921
12925
"int * a;\n"
12922
12926
"int * a;};",
12923
- getGoogleStyle() );
12927
+ Style );
12924
12928
}
12925
12929
12926
12930
TEST_F(FormatTest, UnderstandsRvalueReferences) {
@@ -13056,7 +13060,7 @@ TEST_F(FormatTest, FormatsCasts) {
13056
13060
verifyFormat("virtual void foo(char &) const;");
13057
13061
verifyFormat("virtual void foo(int *a, char *) const;");
13058
13062
verifyFormat("int a = sizeof(int *) + b;");
13059
- verifyGoogleFormat("int a = alignof(int *) + b;");
13063
+ verifyGoogleFormat("int a = alignof(int*) + b;");
13060
13064
verifyFormat("bool b = f(g<int>) && c;");
13061
13065
verifyFormat("typedef void (*f)(int i) func;");
13062
13066
verifyFormat("void operator++(int) noexcept;");
@@ -25425,7 +25429,7 @@ TEST_F(FormatTest, AtomicQualifier) {
25425
25429
verifyFormat("struct foo {\n"
25426
25430
" int a1;\n"
25427
25431
" _Atomic(a) a2;\n"
25428
- " _Atomic(_Atomic(int) * const) a3;\n"
25432
+ " _Atomic(_Atomic(int)* const) a3;\n"
25429
25433
"};",
25430
25434
Google);
25431
25435
verifyFormat("_Atomic(uint64_t) a;");
0 commit comments