Fixed false positive: Exclude STL shared pointers from checkPassByReference() (#7834)
This commit is contained in:
parent
c87e83575a
commit
1c3f010935
|
@ -1455,7 +1455,7 @@ void CheckOther::checkPassByReference()
|
|||
const Token* const tok = var->typeStartToken();
|
||||
if (var->isStlStringType()) {
|
||||
;
|
||||
} else if (var->isStlType() && Token::Match(tok, "std :: %type% <") && !Token::simpleMatch(tok->linkAt(3), "> ::") && tok->strAt(2) != "initializer_list") {
|
||||
} else if (var->isStlType() && Token::Match(tok, "std :: %type% <") && !Token::simpleMatch(tok->linkAt(3), "> ::") && !Token::Match(tok->tokAt(2), "initializer_list|shared_ptr|weak_ptr|unique_ptr|auto_ptr")) {
|
||||
;
|
||||
} else if (var->type() && !var->type()->isEnumType()) { // Check if type is a struct or class.
|
||||
// Ensure that it is a large object.
|
||||
|
|
Loading…
Reference in New Issue