Skip to content

Commit f47238f

Browse files
committed
ignore parens for the DeclRefExpr of the parameter
1 parent 1c3d627 commit f47238f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang-tools-extra/clang-tidy/bugprone/ReturnConstRefFromParameterCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ using namespace clang::ast_matchers;
1616
namespace clang::tidy::bugprone {
1717

1818
void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) {
19-
const auto DRef =
19+
const auto DRef = ignoringParens(
2020
declRefExpr(
2121
to(parmVarDecl(hasType(hasCanonicalType(
2222
qualType(lValueReferenceType(pointee(
2323
qualType(isConstQualified()))))
2424
.bind("type"))))
2525
.bind("param")))
26-
.bind("dref");
26+
.bind("dref"));
2727
const auto Func =
2828
functionDecl(hasReturnTypeLoc(loc(
2929
qualType(hasCanonicalType(equalsBoundNode("type"))))))

0 commit comments

Comments
 (0)