@@ -8571,10 +8571,10 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
85718571 "operator<<(const SomeLooooooooooooooooooooooooogType &other);");
85728572 verifyGoogleFormat(
85738573 "SomeLoooooooooooooooooooooooooooooogType operator>>(\n"
8574- " const SomeLooooooooogType & a, const SomeLooooooooogType & b);");
8574+ " const SomeLooooooooogType& a, const SomeLooooooooogType& b);");
85758575 verifyGoogleFormat(
85768576 "SomeLoooooooooooooooooooooooooooooogType operator<<(\n"
8577- " const SomeLooooooooogType & a, const SomeLooooooooogType & b);");
8577+ " const SomeLooooooooogType& a, const SomeLooooooooogType& b);");
85788578
85798579 verifyFormat("void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
85808580 " int aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1);");
@@ -8583,7 +8583,7 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
85838583 verifyGoogleFormat(
85848584 "typename aaaaaaaaaa<aaaaaa>::aaaaaaaaaaa\n"
85858585 "aaaaaaaaaa<aaaaaa>::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
8586- " bool * aaaaaaaaaaaaaaaaaa, bool * aa) {}");
8586+ " bool* aaaaaaaaaaaaaaaaaa, bool* aa) {}");
85878587 verifyGoogleFormat("template <typename T>\n"
85888588 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
85898589 "aaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaaaaa(\n"
@@ -12891,27 +12891,31 @@ TEST_F(FormatTest, UnderstandsEllipsis) {
1289112891}
1289212892
1289312893TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
12894+ auto Style = getGoogleStyle();
12895+ EXPECT_FALSE(Style.DerivePointerAlignment);
12896+ Style.DerivePointerAlignment = true;
12897+
1289412898 verifyFormat("int *a;\n"
1289512899 "int *a;\n"
1289612900 "int *a;",
1289712901 "int *a;\n"
1289812902 "int* a;\n"
1289912903 "int *a;",
12900- getGoogleStyle() );
12904+ Style );
1290112905 verifyFormat("int* a;\n"
1290212906 "int* a;\n"
1290312907 "int* a;",
1290412908 "int* a;\n"
1290512909 "int* a;\n"
1290612910 "int *a;",
12907- getGoogleStyle() );
12911+ Style );
1290812912 verifyFormat("int *a;\n"
1290912913 "int *a;\n"
1291012914 "int *a;",
1291112915 "int *a;\n"
1291212916 "int * a;\n"
1291312917 "int * a;",
12914- getGoogleStyle() );
12918+ Style );
1291512919 verifyFormat("auto x = [] {\n"
1291612920 " int *a;\n"
1291712921 " int *a;\n"
@@ -12920,7 +12924,7 @@ TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
1292012924 "auto x=[]{int *a;\n"
1292112925 "int * a;\n"
1292212926 "int * a;};",
12923- getGoogleStyle() );
12927+ Style );
1292412928}
1292512929
1292612930TEST_F(FormatTest, UnderstandsRvalueReferences) {
@@ -13056,7 +13060,7 @@ TEST_F(FormatTest, FormatsCasts) {
1305613060 verifyFormat("virtual void foo(char &) const;");
1305713061 verifyFormat("virtual void foo(int *a, char *) const;");
1305813062 verifyFormat("int a = sizeof(int *) + b;");
13059- verifyGoogleFormat("int a = alignof(int *) + b;");
13063+ verifyGoogleFormat("int a = alignof(int*) + b;");
1306013064 verifyFormat("bool b = f(g<int>) && c;");
1306113065 verifyFormat("typedef void (*f)(int i) func;");
1306213066 verifyFormat("void operator++(int) noexcept;");
@@ -25425,7 +25429,7 @@ TEST_F(FormatTest, AtomicQualifier) {
2542525429 verifyFormat("struct foo {\n"
2542625430 " int a1;\n"
2542725431 " _Atomic(a) a2;\n"
25428- " _Atomic(_Atomic(int) * const) a3;\n"
25432+ " _Atomic(_Atomic(int)* const) a3;\n"
2542925433 "};",
2543025434 Google);
2543125435 verifyFormat("_Atomic(uint64_t) a;");
0 commit comments