[clang-tools-extra] r331822 - Partially revert r331456: [clang-tidy] Remove AnalyzeTemporaryDtors option.
Roman Lebedev via cfe-commits
cfe-commits at lists.llvm.org
Tue May 8 16:15:58 PDT 2018
Author: lebedevri
Date: Tue May 8 16:15:58 2018
New Revision: 331822
URL: http://llvm.org/viewvc/llvm-project?rev=331822&view=rev
Log:
Partially revert r331456: [clang-tidy] Remove AnalyzeTemporaryDtors option.
That broke every single .clang-tidy config out there
which happened to specify AnalyzeTemporaryDtors option:
YAML:5:24: error: unknown key 'AnalyzeTemporaryDtors'
AnalyzeTemporaryDtors: false
^~~~~
Error parsing <...>/.clang-tidy: Invalid argument
More so, that error isn't actually a error, the
clang-tidy does not exit with $? != 0, it continues
with the default config.
Surely this breakage isn't the intended behavior.
But if it is, feel free to revert this commit.
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyOptionsTest.cpp
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp?rev=331822&r1=331821&r2=331822&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyOptions.cpp Tue May 8 16:15:58 2018
@@ -83,9 +83,11 @@ template <> struct MappingTraits<ClangTi
static void mapping(IO &IO, ClangTidyOptions &Options) {
MappingNormalization<NOptionMap, ClangTidyOptions::OptionMap> NOpts(
IO, Options.CheckOptions);
+ bool Ignored = false;
IO.mapOptional("Checks", Options.Checks);
IO.mapOptional("WarningsAsErrors", Options.WarningsAsErrors);
IO.mapOptional("HeaderFilterRegex", Options.HeaderFilterRegex);
+ IO.mapOptional("AnalyzeTemporaryDtors", Ignored); // legacy compatibility
IO.mapOptional("FormatStyle", Options.FormatStyle);
IO.mapOptional("User", Options.User);
IO.mapOptional("CheckOptions", NOpts->Options);
Modified: clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyOptionsTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyOptionsTest.cpp?rev=331822&r1=331821&r2=331822&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyOptionsTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyOptionsTest.cpp Tue May 8 16:15:58 2018
@@ -58,6 +58,7 @@ TEST(ParseConfiguration, ValidConfigurat
llvm::ErrorOr<ClangTidyOptions> Options =
parseConfiguration("Checks: \"-*,misc-*\"\n"
"HeaderFilterRegex: \".*\"\n"
+ "AnalyzeTemporaryDtors: true\n"
"User: some.user");
EXPECT_TRUE(!!Options);
EXPECT_EQ("-*,misc-*", *Options->Checks);
@@ -69,6 +70,7 @@ TEST(ParseConfiguration, MergeConfigurat
llvm::ErrorOr<ClangTidyOptions> Options1 = parseConfiguration(R"(
Checks: "check1,check2"
HeaderFilterRegex: "filter1"
+ AnalyzeTemporaryDtors: true
User: user1
ExtraArgs: ['arg1', 'arg2']
ExtraArgsBefore: ['arg-before1', 'arg-before2']
@@ -77,6 +79,7 @@ TEST(ParseConfiguration, MergeConfigurat
llvm::ErrorOr<ClangTidyOptions> Options2 = parseConfiguration(R"(
Checks: "check3,check4"
HeaderFilterRegex: "filter2"
+ AnalyzeTemporaryDtors: false
User: user2
ExtraArgs: ['arg3', 'arg4']
ExtraArgsBefore: ['arg-before3', 'arg-before4']
More information about the cfe-commits
mailing list