================
@@ -18,14 +18,17 @@ namespace clang::tidy::bugprone {
 void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) {
   const auto DRef = ignoringParens(
       declRefExpr(
-          to(parmVarDecl(hasType(hasCanonicalType(
-                             qualType(lValueReferenceType(pointee(
-                                          qualType(isConstQualified()))))
-                                 .bind("type"))))
+          to(parmVarDecl(
+                 hasType(hasCanonicalType(
+                     qualType(lValueReferenceType(
+                                  pointee(qualType(isConstQualified()))))
+                         .bind("type"))),
+                 parmVarDecl(hasDeclContext(functionDecl().bind("owner"))))
----------------
PiotrZSL wrote:

no need for duplicating parmVarDecl

https://github.com/llvm/llvm-project/pull/117734
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to