r372939 - [clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919
MyDeveloper Day via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 25 22:59:12 PDT 2019
Thank you for fixing this...
On Thu, Sep 26, 2019 at 3:00 AM Fangrui Song via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: maskray
> Date: Wed Sep 25 19:02:17 2019
> New Revision: 372939
>
> URL: http://llvm.org/viewvc/llvm-project?rev=372939&view=rev
> Log:
> [clang-format] Add SortPriority fields to fix -Wmissing-field-initializers
> after D64695/r372919
>
> Modified:
> cfe/trunk/lib/Format/Format.cpp
> cfe/trunk/unittests/Format/FormatTest.cpp
>
> Modified: cfe/trunk/lib/Format/Format.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=372939&r1=372938&r2=372939&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Format/Format.cpp (original)
> +++ cfe/trunk/lib/Format/Format.cpp Wed Sep 25 19:02:17 2019
> @@ -734,9 +734,9 @@ FormatStyle getLLVMStyle(FormatStyle::La
> 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::
> 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;
>
> Modified: cfe/trunk/unittests/Format/FormatTest.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Format/FormatTest.cpp?rev=372939&r1=372938&r2=372939&view=diff
>
> ==============================================================================
> --- cfe/trunk/unittests/Format/FormatTest.cpp (original)
> +++ cfe/trunk/unittests/Format/FormatTest.cpp Wed Sep 25 19:02:17 2019
> @@ -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"
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190926/53b577b5/attachment.html>
More information about the cfe-commits
mailing list