Index: unittests/Format/FormatTest.cpp =================================================================== --- unittests/Format/FormatTest.cpp +++ unittests/Format/FormatTest.cpp @@ -8148,6 +8148,8 @@ Spaces.SpacesInParentheses = true; verifyFormat("call( x, y, z );", Spaces); + verifyFormat("call();", Spaces); + verifyFormat("std::function callback;", Spaces); verifyFormat("while ( (bool)1 )\n" " continue;", Spaces); verifyFormat("for ( ;; )\n" @@ -8174,19 +8176,13 @@ verifyFormat("my_int a = ( my_int )sizeof(int);", Spaces); verifyFormat("#define x (( int )-1)", Spaces); - Spaces.SpacesInParentheses = false; - Spaces.SpaceInEmptyParentheses = true; - verifyFormat("call(x, y, z);", Spaces); - verifyFormat("call( )", Spaces); - - // Run the first set of tests again with - // Spaces.SpacesInParentheses = false, - // Spaces.SpaceInEmptyParentheses = true and - // Spaces.SpacesInCStyleCastParentheses = true + // Run the first set of tests again with: Spaces.SpacesInParentheses = false, Spaces.SpaceInEmptyParentheses = true; Spaces.SpacesInCStyleCastParentheses = true; verifyFormat("call(x, y, z);", Spaces); + verifyFormat("call( );", Spaces); + verifyFormat("std::function callback;", Spaces); verifyFormat("while (( bool )1)\n" " continue;", Spaces); verifyFormat("for (;;)\n" @@ -8203,8 +8199,11 @@ " break;\n" "}", Spaces); + // Run the first set of tests again with: Spaces.SpaceAfterCStyleCast = true; verifyFormat("call(x, y, z);", Spaces); + verifyFormat("call( );", Spaces); + verifyFormat("std::function callback;", Spaces); verifyFormat("while (( bool ) 1)\n" " continue;", Spaces); @@ -8225,6 +8224,8 @@ " break;\n" "}", Spaces); + + // Run subset of tests again with: Spaces.SpacesInCStyleCastParentheses = false; Spaces.SpaceAfterCStyleCast = true; verifyFormat("while ((bool) 1)\n"