diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:12:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:12:52 +0100 |
commit | 0d2ac4afe9f583dee64a5dcebb93caf7d42d0891 (patch) | |
tree | 242c92766c5e449ec8452541552151e672638239 /compilerplugins/clang/stringconstant.cxx | |
parent | d86f83b6d942fa18ffb1e74daff6032dea954dda (diff) |
New loplugin:conststringvar
Change-Id: I16648b018ed0f69a085322cfb88481ee2a0c27ca
Diffstat (limited to 'compilerplugins/clang/stringconstant.cxx')
-rw-r--r-- | compilerplugins/clang/stringconstant.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index 2afd923147d6..d8f04a6cd797 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -289,6 +289,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) { { // u.equalsIgnoreAsciiCaseAscii("foo") -> // u.equalsIngoreAsciiCase("foo"): + std::string file( + compiler.getSourceManager().getFilename( + compiler.getSourceManager().getSpellingLoc( + expr->getLocStart()))); + if (file == SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx") { + return true; + } handleChar( expr, 0, fdecl, "rtl::OUString::equalsIgnoreAsciiCase", TreatEmpty::CheckEmpty, false); @@ -300,6 +307,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) { { // u.equalsIgnoreAsciiCaseAsciiL("foo", 3) -> // u.equalsIngoreAsciiCase("foo"): + std::string file( + compiler.getSourceManager().getFilename( + compiler.getSourceManager().getSpellingLoc( + expr->getLocStart()))); + if (file == SRCDIR "/sal/qa/rtl/strings/test_oustring_compare.cxx") { + return true; + } handleCharLen( expr, 0, 1, fdecl, "rtl::OUString::equalsIgnoreAsciiCase", TreatEmpty::CheckEmpty); |