summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
index c6b384b3ac4..21f4a8a5d05 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantStringCStrCheck.cpp
@@ -77,7 +77,8 @@ void RedundantStringCStrCheck::registerMatchers(
return;
// Match expressions of type 'string' or 'string*'.
- const auto StringDecl = cxxRecordDecl(hasName("::std::basic_string"));
+ const auto StringDecl = type(hasUnqualifiedDesugaredType(recordType(
+ hasDeclaration(cxxRecordDecl(hasName("::std::basic_string"))))));
const auto StringExpr =
expr(anyOf(hasType(StringDecl), hasType(qualType(pointsTo(StringDecl)))));
OpenPOWER on IntegriCloud