We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b00b02b commit 1c3d627Copy full SHA for 1c3d627
clang-tools-extra/clang-tidy/bugprone/ReturnConstRefFromParameterCheck.cpp
@@ -30,10 +30,11 @@ void ReturnConstRefFromParameterCheck::registerMatchers(MatchFinder *Finder) {
30
.bind("func");
31
32
Finder->addMatcher(returnStmt(hasReturnValue(DRef), hasAncestor(Func)), this);
33
- Finder->addMatcher(conditionalOperator(eachOf(hasTrueExpression(DRef),
34
- hasFalseExpression(DRef)),
35
- hasAncestor(Func)),
36
- this);
+ Finder->addMatcher(
+ returnStmt(hasReturnValue(ignoringParens(conditionalOperator(
+ eachOf(hasTrueExpression(DRef), hasFalseExpression(DRef)),
+ hasAncestor(Func))))),
37
+ this);
38
}
39
40
static bool isSameTypeIgnoringConst(QualType A, QualType B) {
0 commit comments