diff options
author | Fangrui Song <maskray@google.com> | 2019-09-26 02:02:17 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-09-26 02:02:17 +0000 |
commit | f0458283d0572eeb8c1c41be4aa717e8f1170aff (patch) | |
tree | bd6b97392b477743a37ff7fd445b20382772ed71 /clang | |
parent | f57e968dd036b2230c59c00e1ed10fecf1668828 (diff) | |
download | bcm5719-llvm-f0458283d0572eeb8c1c41be4aa717e8f1170aff.tar.gz bcm5719-llvm-f0458283d0572eeb8c1c41be4aa717e8f1170aff.zip |
[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919
llvm-svn: 372939
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Format/Format.cpp | 12 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index b64d4825240..07fdcc83af1 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -734,9 +734,9 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) { LLVMStyle.ForEachMacros.push_back("Q_FOREACH"); LLVMStyle.ForEachMacros.push_back("BOOST_FOREACH"); LLVMStyle.IncludeStyle.IncludeCategories = { - {"^\"(llvm|llvm-c|clang|clang-c)/", 2}, - {"^(<|\"(gtest|gmock|isl|json)/)", 3}, - {".*", 1}}; + {"^\"(llvm|llvm-c|clang|clang-c)/", 2, 0}, + {"^(<|\"(gtest|gmock|isl|json)/)", 3, 0}, + {".*", 1, 0}}; LLVMStyle.IncludeStyle.IncludeIsMainRegex = "(Test)?$"; LLVMStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Preserve; LLVMStyle.IndentCaseLabels = false; @@ -818,8 +818,10 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { GoogleStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; GoogleStyle.ConstructorInitializerAllOnOneLineOrOnePerLine = true; GoogleStyle.DerivePointerAlignment = true; - GoogleStyle.IncludeStyle.IncludeCategories = { - {"^<ext/.*\\.h>", 2}, {"^<.*\\.h>", 1}, {"^<.*", 2}, {".*", 3}}; + GoogleStyle.IncludeStyle.IncludeCategories = {{"^<ext/.*\\.h>", 2, 0}, + {"^<.*\\.h>", 1, 0}, + {"^<.*", 2, 0}, + {".*", 3, 0}}; GoogleStyle.IncludeStyle.IncludeIsMainRegex = "([-_](test|unittest))?$"; GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup; GoogleStyle.IndentCaseLabels = true; diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 94eab1a6af5..581d15672ba 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -12463,7 +12463,7 @@ TEST_F(FormatTest, ParsesConfiguration) { Style.IncludeStyle.IncludeCategories.clear(); std::vector<tooling::IncludeStyle::IncludeCategory> ExpectedCategories = { - {"abc/.*", 2}, {".*", 1}}; + {"abc/.*", 2, 0}, {".*", 1, 0}}; CHECK_PARSE("IncludeCategories:\n" " - Regex: abc/.*\n" " Priority: 2\n" |