Use error_code() instead of error_code::succes()
There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.
llvm-svn: 209953
diff --git a/clang-tools-extra/clang-modernize/Core/IncludeExcludeInfo.cpp b/clang-tools-extra/clang-modernize/Core/IncludeExcludeInfo.cpp
index 016ce55..3d08a0b6 100644
--- a/clang-tools-extra/clang-modernize/Core/IncludeExcludeInfo.cpp
+++ b/clang-tools-extra/clang-modernize/Core/IncludeExcludeInfo.cpp
@@ -103,7 +103,7 @@
llvm::errs() << "Parse: " <<List.back() << "\n";
}
- return error_code::success();
+ return error_code();
}
} // end anonymous namespace
@@ -115,7 +115,7 @@
if (error_code Err = parseCLInput(ExcludeString, ExcludeList,
/*Separator=*/ ","))
return Err;
- return error_code::success();
+ return error_code();
}
error_code IncludeExcludeInfo::readListFromFile(StringRef IncludeListFile,
@@ -140,7 +140,7 @@
/*Separator=*/ "\n"))
return Err;
}
- return error_code::success();
+ return error_code();
}
bool IncludeExcludeInfo::isFileIncluded(StringRef FilePath) const {
diff --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index 93c0c4c..3e22b5f 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/modularize/Modularize.cpp
@@ -284,7 +284,7 @@
Dependencies[HeaderFileName.str()] = Dependents;
}
- return error_code::success();
+ return error_code();
}
// Helper function for finding the input file in an arguments list.
diff --git a/clang-tools-extra/unittests/clang-modernize/IncludeExcludeTest.cpp b/clang-tools-extra/unittests/clang-modernize/IncludeExcludeTest.cpp
index 232a47a..2b703db 100644
--- a/clang-tools-extra/unittests/clang-modernize/IncludeExcludeTest.cpp
+++ b/clang-tools-extra/unittests/clang-modernize/IncludeExcludeTest.cpp
@@ -20,7 +20,7 @@
/*include=*/ "a,b/b2,c/c2,d/../d2/../d3",
/*exclude=*/ "a/af.cpp,a/a2,b/b2/b2f.cpp,c/c2");
- ASSERT_EQ(Err, llvm::error_code::success());
+ ASSERT_EQ(Err, llvm::error_code());
// If the file does not appear on the include list then it is not safe to
// transform. Files are not safe to transform by default.
@@ -65,7 +65,7 @@
/*include=*/ "a/.,b/b2/,c/c2/c3/../../c4/,d/d2/./d3/,/e/e2/.",
/*exclude=*/ "");
- ASSERT_EQ(Err, llvm::error_code::success());
+ ASSERT_EQ(Err, llvm::error_code());
EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));
EXPECT_TRUE(IEManager.isFileIncluded("b/b2/f.cpp"));
@@ -126,7 +126,7 @@
llvm::error_code Err = IEManager.readListFromFile(
UnixFiles.IncludeDataPath.c_str(), UnixFiles.ExcludeDataPath.c_str());
- ASSERT_EQ(Err, llvm::error_code::success());
+ ASSERT_EQ(Err, llvm::error_code());
EXPECT_FALSE(IEManager.isFileIncluded("f.cpp"));
EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));
@@ -141,7 +141,7 @@
llvm::error_code Err = IEManager.readListFromFile(
DOSFiles.IncludeDataPath.c_str(), DOSFiles.ExcludeDataPath.c_str());
- ASSERT_EQ(Err, llvm::error_code::success());
+ ASSERT_EQ(Err, llvm::error_code());
EXPECT_FALSE(IEManager.isFileIncluded("f.cpp"));
EXPECT_TRUE(IEManager.isFileIncluded("a/f.cpp"));