Skip to content

Commit 3496245

Browse files
authored
[clang-format] Change GNU style language standard to LS_Latest (#104669)
Fixes #104655.
1 parent bf5cd42 commit 3496245

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

clang/lib/Format/Format.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,6 @@ FormatStyle getGNUStyle() {
19051905
Style.Cpp11BracedListStyle = false;
19061906
Style.FixNamespaceComments = false;
19071907
Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
1908-
Style.Standard = FormatStyle::LS_Cpp03;
19091908
return Style;
19101909
}
19111910

clang/unittests/Format/TokenAnnotatorTest.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,6 +3360,15 @@ TEST_F(TokenAnnotatorTest, TypenameMacro) {
33603360
EXPECT_TOKEN(Tokens[6], tok::l_brace, TT_Unknown);
33613361
}
33623362

3363+
TEST_F(TokenAnnotatorTest, GNULanguageStandard) {
3364+
auto Style = getGNUStyle();
3365+
EXPECT_EQ(Style.Standard, FormatStyle::LS_Latest);
3366+
3367+
auto Tokens = annotate("return 1 <=> 2;", Style);
3368+
ASSERT_EQ(Tokens.size(), 6u);
3369+
EXPECT_TOKEN(Tokens[2], tok::spaceship, TT_BinaryOperator);
3370+
}
3371+
33633372
} // namespace
33643373
} // namespace format
33653374
} // namespace clang

0 commit comments

Comments
 (0)