[clang-tools-extra] [clang-tidy] Fix `readability-container-data-pointer` check (PR #165636)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 08:23:09 PDT 2025


================
@@ -107,8 +107,11 @@ void ContainerDataPointerCheck::check(const MatchFinder::MatchResult &Result) {
       Lexer::getSourceText(CharSourceRange::getTokenRange(SrcRange),
                            *Result.SourceManager, getLangOpts())};
 
-  if (!isa<DeclRefExpr, ArraySubscriptExpr, CXXOperatorCallExpr, CallExpr,
-           MemberExpr>(CE))
+  const auto *OpCall = dyn_cast<CXXOperatorCallExpr>(CE);
+  bool NeedsParens =
----------------
EugeneZelenko wrote:

```suggestion
  const bool NeedsParens =
```

https://github.com/llvm/llvm-project/pull/165636


More information about the cfe-commits mailing list