[clang-tools-extra] r208898 - Fixed incorrect StringRef::find usage.
Alexander Kornienko
alexfh at google.com
Thu May 15 08:56:58 PDT 2014
Author: alexfh
Date: Thu May 15 10:56:58 2014
New Revision: 208898
URL: http://llvm.org/viewvc/llvm-project?rev=208898&view=rev
Log:
Fixed incorrect StringRef::find usage.
Modified:
clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
Modified: clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp?rev=208898&r1=208897&r2=208898&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/ClangTidyDiagnosticConsumer.cpp Thu May 15 10:56:58 2014
@@ -130,7 +130,7 @@ static llvm::Regex ConsumeGlob(StringRef
for (char C : Glob) {
if (C == '*')
RegexText.push_back('.');
- else if (MetaChars.find(C))
+ else if (MetaChars.find(C) != StringRef::npos)
RegexText.push_back('\\');
RegexText.push_back(C);
}
Modified: clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp?rev=208898&r1=208897&r2=208898&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp (original)
+++ clang-tools-extra/trunk/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp Thu May 15 10:56:58 2014
@@ -66,7 +66,7 @@ TEST(ChecksFilter, Simple) {
}
TEST(ChecksFilter, Complex) {
- ChecksFilter Filter("*,-a.*,-b.*,a.a.*,-a.a.a.*,-..,-...,-..+,-*$,-*qwe*");
+ ChecksFilter Filter("*,-a.*,-b.*,a.1.*,-a.1.A.*,-..,-...,-..+,-*$,-*qwe*");
EXPECT_TRUE(Filter.isCheckEnabled("aaa"));
EXPECT_TRUE(Filter.isCheckEnabled("qqq"));
@@ -74,8 +74,8 @@ TEST(ChecksFilter, Complex) {
EXPECT_FALSE(Filter.isCheckEnabled("a.b"));
EXPECT_FALSE(Filter.isCheckEnabled("b."));
EXPECT_FALSE(Filter.isCheckEnabled("b.b"));
- EXPECT_TRUE(Filter.isCheckEnabled("a.a.b"));
- EXPECT_FALSE(Filter.isCheckEnabled("a.a.a.a"));
+ EXPECT_TRUE(Filter.isCheckEnabled("a.1.b"));
+ EXPECT_FALSE(Filter.isCheckEnabled("a.1.A.a"));
EXPECT_FALSE(Filter.isCheckEnabled("qwe"));
EXPECT_FALSE(Filter.isCheckEnabled("asdfqweasdf"));
EXPECT_TRUE(Filter.isCheckEnabled("asdfqwEasdf"));
More information about the cfe-commits
mailing list