From 228166a4ca07bc5bb87b2097fc947e1c262b06a5 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 31 May 2014 02:00:59 +0000 Subject: [PATCH] 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 --- clang-tools-extra/clang-modernize/Core/IncludeExcludeInfo.cpp | 6 +++--- clang-tools-extra/modularize/Modularize.cpp | 2 +- .../unittests/clang-modernize/IncludeExcludeTest.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) 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 @@ error_code parseCLInput(StringRef Line, std::vector &List, llvm::errs() << "Parse: " < &HeaderFileNames, 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 @@ TEST(IncludeExcludeTest, ParseString) { /*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 @@ TEST(IncludeExcludeTest, ParseStringCases) { /*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 @@ TEST(IncludeExcludeFileTest, UNIXFile) { 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 @@ TEST(IncludeExcludeFileTest, DOSFile) { 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")); -- 2.7.4