From 5d7fa590af001a7c4221077f900e610156c91b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 8 Mar 2017 10:23:38 +0100 Subject: [PATCH] Don't check ignored function return value in ({..}). Ticket: #7934 --- lib/checkfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkfunctions.cpp b/lib/checkfunctions.cpp index 479c11cd0..d325e8fa0 100644 --- a/lib/checkfunctions.cpp +++ b/lib/checkfunctions.cpp @@ -156,8 +156,8 @@ void CheckFunctions::checkIgnoredReturnValue() for (std::size_t i = 0; i < functions; ++i) { const Scope * scope = symbolDatabase->functionScopes[i]; for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) { - // c++11 initialization - if (Token::Match(tok, "%var% (| {")) + // skip c++11 initialization, ({...}) + if (Token::Match(tok, "%var%|( {")) tok = tok->linkAt(1); if (tok->varId() || !Token::Match(tok, "%name% ("))