diff options
author | Owen Pan <owenpiano@gmail.com> | 2024-01-31 20:20:26 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 20:20:26 -0800 |
commit | 908fd09a13b2e89a52282478544f7f70cf0a887f (patch) | |
tree | 9f76aad08ef9fab2d258d375ec654dc4578860e4 /clang/unittests/Format/ConfigParseTest.cpp | |
parent | a8279a8bc541b6027087dd497daa63b6602b7f4b (diff) | |
download | llvm-908fd09a13b2e89a52282478544f7f70cf0a887f.zip llvm-908fd09a13b2e89a52282478544f7f70cf0a887f.tar.gz llvm-908fd09a13b2e89a52282478544f7f70cf0a887f.tar.bz2 |
[clang-format] Simplify the AfterPlacementOperator option (#79796)
Change AfterPlacementOperator to a boolean and deprecate SBPO_Never,
which meant never inserting a space except when after new/delete.
Fixes #78892.
Diffstat (limited to 'clang/unittests/Format/ConfigParseTest.cpp')
-rw-r--r-- | clang/unittests/Format/ConfigParseTest.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/clang/unittests/Format/ConfigParseTest.cpp b/clang/unittests/Format/ConfigParseTest.cpp index 2a8d793..6436581 100644 --- a/clang/unittests/Format/ConfigParseTest.cpp +++ b/clang/unittests/Format/ConfigParseTest.cpp @@ -231,6 +231,7 @@ TEST(ConfigParseTest, ParsesConfigurationBools) { AfterFunctionDefinitionName); CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, AfterIfMacros); CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, AfterOverloadedOperator); + CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, AfterPlacementOperator); CHECK_PARSE_NESTED_BOOL(SpaceBeforeParensOptions, BeforeNonEmptyParentheses); CHECK_PARSE_NESTED_BOOL(SpacesInParensOptions, InCStyleCasts); CHECK_PARSE_NESTED_BOOL(SpacesInParensOptions, InConditionalStatements); @@ -609,24 +610,6 @@ TEST(ConfigParseTest, ParsesConfiguration) { SpaceBeforeParens, FormatStyle::SBPO_ControlStatementsExceptControlMacros); - Style.SpaceBeforeParens = FormatStyle::SBPO_Custom; - Style.SpaceBeforeParensOptions.AfterPlacementOperator = - FormatStyle::SpaceBeforeParensCustom::APO_Always; - CHECK_PARSE("SpaceBeforeParensOptions:\n" - " AfterPlacementOperator: Never", - SpaceBeforeParensOptions.AfterPlacementOperator, - FormatStyle::SpaceBeforeParensCustom::APO_Never); - - CHECK_PARSE("SpaceBeforeParensOptions:\n" - " AfterPlacementOperator: Always", - SpaceBeforeParensOptions.AfterPlacementOperator, - FormatStyle::SpaceBeforeParensCustom::APO_Always); - - CHECK_PARSE("SpaceBeforeParensOptions:\n" - " AfterPlacementOperator: Leave", - SpaceBeforeParensOptions.AfterPlacementOperator, - FormatStyle::SpaceBeforeParensCustom::APO_Leave); - // For backward compatibility: Style.SpacesInParens = FormatStyle::SIPO_Never; Style.SpacesInParensOptions = {}; |