================
@@ -47,6 +60,15 @@ void RedundantParenthesesCheck::registerMatchers(MatchFinder 
*Finder) {
 
 void RedundantParenthesesCheck::check(const MatchFinder::MatchResult &Result) {
   const auto *PE = Result.Nodes.getNodeAs<ParenExpr>("dup");
+  if (auto *DRE = dyn_cast<DeclRefExpr>(PE->getSubExpr())) {
+    const std::string Name = DRE->getDecl()->getQualifiedNameAsString();
+    llvm::errs() << Name << "\n";
+    bool Allowed = llvm::any_of(AllowedDecls, [&Name](const llvm::Regex &NM) {
----------------
vbvictor wrote:

Do we construct regex on each invocation from each name in `AllowedDecls`? We 
could probably do it one time in `storeOptions`.
Also, do we even need regex here? In docs it doesn't say about regex, so if we 
want to keep regex we should mention it.

https://github.com/llvm/llvm-project/pull/164827
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to