Skip to content

Commit 754b93f

Browse files
authored
Patch .clang-format files to specify C++20. (flutter#174848)
Clang format will reject valid uses of C++ (like the spaceship operator definition) because they are not valid C++11. This tweaks how clang-format treats sources. I tried to get rid of the redundant .clang-format files but they all specify other options and don't cascade. So just let the files be and only updated the version.
1 parent 661b8ed commit 754b93f

4 files changed

Lines changed: 6 additions & 12 deletions

File tree

engine/src/.clang-format

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Defines the Chromium style for automatic reformatting.
22
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
33
BasedOnStyle: Chromium
4-
# This defaults to 'Auto'. Explicitly set it for a while, so that
5-
# 'vector<vector<int> >' in existing files gets formatted to
6-
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
7-
# 'int>>' if the file already contains at least one such instance.)
8-
Standard: Cpp11
4+
# This defaults to 'Auto'.
5+
Standard: c++20

engine/src/flutter/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ BasedOnStyle: Chromium
55
# 'vector<vector<int> >' in existing files gets formatted to
66
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
77
# 'int>>' if the file already contains at least one such instance.)
8-
Standard: Cpp11
8+
Standard: c++20
99
SortIncludes: true
1010
---
1111
Language: ObjC
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Defines the Chromium style for automatic reformatting.
22
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
33
BasedOnStyle: Chromium
4-
Standard: c++17
4+
Standard: c++20
55
EmptyLineBeforeAccessModifier: Always
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Defines the Chromium style for automatic reformatting.
22
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
33
BasedOnStyle: Chromium
4-
# This defaults to 'Auto'. Explicitly set it for a while, so that
5-
# 'vector<vector<int> >' in existing files gets formatted to
6-
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
7-
# 'int>>' if the file already contains at least one such instance.)
8-
Standard: Cpp11
4+
# This defaults to 'Auto'.
5+
Standard: c++20

0 commit comments

Comments
 (0)