Fixed false positive: Exclude STL shared pointers from checkPassByReference() (#7834)

This commit is contained in:
PKEuS 2017-03-07 21:04:19 +01:00
parent c87e83575a
commit 1c3f010935
1 changed files with 1 additions and 1 deletions

View File

@ -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.