@@ -6487,7 +6487,6 @@ static const Token* parsedecl(const Token* type,
64876487 ValueType* const valuetype,
64886488 ValueType::Sign defaultSignedness,
64896489 const Settings& settings,
6490- bool isCpp,
64916490 SourceLocation loc = SourceLocation::current());
64926491
64936492void SymbolDatabase::setValueType (Token* tok, const Variable& var, const SourceLocation &loc)
@@ -6509,7 +6508,7 @@ void SymbolDatabase::setValueType(Token* tok, const Variable& var, const SourceL
65096508 valuetype.containerTypeToken = var.valueType ()->containerTypeToken ;
65106509 }
65116510 valuetype.smartPointerType = var.smartPointerType ();
6512- if (parsedecl (var.typeStartToken (), &valuetype, mDefaultSignedness , mSettings , mIsCpp )) {
6511+ if (parsedecl (var.typeStartToken (), &valuetype, mDefaultSignedness , mSettings )) {
65136512 if (tok->str () == " ." && tok->astOperand1 ()) {
65146513 const ValueType * const vt = tok->astOperand1 ()->valueType ();
65156514 if (vt && (vt->constness & 1 ) != 0 )
@@ -6608,7 +6607,7 @@ void SymbolDatabase::setValueType(Token* tok, const ValueType& valuetype, const
66086607 if (vt1 && vt1->container && vt1->containerTypeToken && Token::Match (parent, " . %name% (" ) &&
66096608 isContainerYieldElement (vt1->container ->getYield (parent->next ()->str ()))) {
66106609 ValueType item;
6611- if (parsedecl (vt1->containerTypeToken , &item, mDefaultSignedness , mSettings , mIsCpp )) {
6610+ if (parsedecl (vt1->containerTypeToken , &item, mDefaultSignedness , mSettings )) {
66126611 if (item.constness == 0 )
66136612 item.constness = vt1->constness ;
66146613 if (item.volatileness == 0 )
@@ -6726,7 +6725,7 @@ void SymbolDatabase::setValueType(Token* tok, const ValueType& valuetype, const
67266725 if (parent->str () == " *" && !parent->astOperand2 () && valuetype.type == ValueType::Type::ITERATOR &&
67276726 valuetype.containerTypeToken ) {
67286727 ValueType vt;
6729- if (parsedecl (valuetype.containerTypeToken , &vt, mDefaultSignedness , mSettings , mIsCpp )) {
6728+ if (parsedecl (valuetype.containerTypeToken , &vt, mDefaultSignedness , mSettings )) {
67306729 if (vt.constness == 0 )
67316730 vt.constness = valuetype.constness ;
67326731 if (vt.volatileness == 0 )
@@ -6740,7 +6739,7 @@ void SymbolDatabase::setValueType(Token* tok, const ValueType& valuetype, const
67406739 if (parent->str () == " *" && !parent->astOperand2 () && valuetype.type == ValueType::Type::SMART_POINTER &&
67416740 valuetype.smartPointerTypeToken ) {
67426741 ValueType vt;
6743- if (parsedecl (valuetype.smartPointerTypeToken , &vt, mDefaultSignedness , mSettings , mIsCpp )) {
6742+ if (parsedecl (valuetype.smartPointerTypeToken , &vt, mDefaultSignedness , mSettings )) {
67446743 if (vt.constness == 0 )
67456744 vt.constness = valuetype.constness ;
67466745 if (vt.volatileness == 0 )
@@ -6873,7 +6872,7 @@ void SymbolDatabase::setValueType(Token* tok, const ValueType& valuetype, const
68736872 autovt.type = ValueType::Type::NONSTD;
68746873 }
68756874 }
6876- } else if (parsedecl (vt2->containerTypeToken , &autovt, mDefaultSignedness , mSettings , mIsCpp )) {
6875+ } else if (parsedecl (vt2->containerTypeToken , &autovt, mDefaultSignedness , mSettings )) {
68776876 setType = true ;
68786877 templateArgType = vt2->containerTypeToken ->type ();
68796878 if (Token::simpleMatch (autoToken->next (), " &" ))
@@ -6921,7 +6920,7 @@ void SymbolDatabase::setValueType(Token* tok, const ValueType& valuetype, const
69216920
69226921 if (vt1 && vt1->containerTypeToken && parent->str () == " [" ) {
69236922 ValueType vtParent;
6924- if (parsedecl (vt1->containerTypeToken , &vtParent, mDefaultSignedness , mSettings , mIsCpp )) {
6923+ if (parsedecl (vt1->containerTypeToken , &vtParent, mDefaultSignedness , mSettings )) {
69256924 setValueType (parent, vtParent);
69266925 return ;
69276926 }
@@ -7100,7 +7099,6 @@ static const Token* parsedecl(const Token* type,
71007099 ValueType* const valuetype,
71017100 ValueType::Sign defaultSignedness,
71027101 const Settings& settings,
7103- bool isCpp,
71047102 SourceLocation loc)
71057103{
71067104 if (settings.debugnormal || settings.debugwarnings )
@@ -7162,7 +7160,7 @@ static const Token* parsedecl(const Token* type,
71627160 if (valuetype->type == ValueType::Type::UNKNOWN_TYPE &&
71637161 type->type () && type->type ()->isTypeAlias () && type->type ()->typeStart &&
71647162 type->type ()->typeStart ->str () != type->str () && type->type ()->typeStart != previousType)
7165- parsedecl (type->type ()->typeStart , valuetype, defaultSignedness, settings, isCpp );
7163+ parsedecl (type->type ()->typeStart , valuetype, defaultSignedness, settings);
71667164 else if (Token::Match (type, " const|constexpr" ))
71677165 valuetype->constness |= (1 << (valuetype->pointer - pointer0));
71687166 else if (Token::simpleMatch (type, " volatile" ))
@@ -7194,7 +7192,7 @@ static const Token* parsedecl(const Token* type,
71947192 if (valuetype->typeScope )
71957193 valuetype->type = (scope->type == Scope::ScopeType::eClass) ? ValueType::Type::RECORD : ValueType::Type::NONSTD;
71967194 }
7197- } else if (const Library::Container* container = (isCpp ? settings.library .detectContainerOrIterator (type, &isIterator) : nullptr )) {
7195+ } else if (const Library::Container* container = (type-> isCpp () ? settings.library .detectContainerOrIterator (type, &isIterator) : nullptr )) {
71987196 if (isIterator)
71997197 valuetype->type = ValueType::Type::ITERATOR;
72007198 else
@@ -7216,7 +7214,7 @@ static const Token* parsedecl(const Token* type,
72167214 // we are past the end of the type
72177215 type = type->previous ();
72187216 continue ;
7219- } else if (const Library::SmartPointer* smartPointer = (isCpp ? settings.library .detectSmartPointer (type) : nullptr )) {
7217+ } else if (const Library::SmartPointer* smartPointer = (type-> isCpp () ? settings.library .detectSmartPointer (type) : nullptr )) {
72207218 const Token* argTok = Token::findsimplematch (type, " <" );
72217219 if (!argTok)
72227220 break ;
@@ -7427,7 +7425,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
74277425 const Function *function = getOperatorFunction (tok);
74287426 if (function) {
74297427 ValueType vt;
7430- parsedecl (function->retDef , &vt, mDefaultSignedness , mSettings , mIsCpp );
7428+ parsedecl (function->retDef , &vt, mDefaultSignedness , mSettings );
74317429 setValueType (tok, vt);
74327430 continue ;
74337431 }
@@ -7463,21 +7461,21 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
74637461 // cast
74647462 if (tok->isCast () && !tok->astOperand2 () && Token::Match (tok, " ( %name%" )) {
74657463 ValueType valuetype;
7466- if (Token::simpleMatch (parsedecl (tok->next (), &valuetype, mDefaultSignedness , mSettings , mIsCpp ), " )" ))
7464+ if (Token::simpleMatch (parsedecl (tok->next (), &valuetype, mDefaultSignedness , mSettings ), " )" ))
74677465 setValueType (tok, valuetype);
74687466 }
74697467
74707468 // C++ cast
74717469 else if (tok->astOperand2 () && Token::Match (tok->astOperand1 (), " static_cast|const_cast|dynamic_cast|reinterpret_cast < %name%" ) && tok->astOperand1 ()->linkAt (1 )) {
74727470 ValueType valuetype;
7473- if (Token::simpleMatch (parsedecl (tok->astOperand1 ()->tokAt (2 ), &valuetype, mDefaultSignedness , mSettings , mIsCpp ), " >" ))
7471+ if (Token::simpleMatch (parsedecl (tok->astOperand1 ()->tokAt (2 ), &valuetype, mDefaultSignedness , mSettings ), " >" ))
74747472 setValueType (tok, valuetype);
74757473 }
74767474
74777475 // Construct smart pointer
74787476 else if (mIsCpp && mSettings .library .isSmartPointer (start)) {
74797477 ValueType valuetype;
7480- if (parsedecl (start, &valuetype, mDefaultSignedness , mSettings , mIsCpp )) {
7478+ if (parsedecl (start, &valuetype, mDefaultSignedness , mSettings )) {
74817479 setValueType (tok, valuetype);
74827480 setValueType (tok->astOperand1 (), valuetype);
74837481 }
@@ -7487,7 +7485,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
74877485 // function or lambda
74887486 else if (const Function* f = getFunction (tok->previous ())) {
74897487 ValueType valuetype;
7490- if (parsedecl (f->retDef , &valuetype, mDefaultSignedness , mSettings , mIsCpp ))
7488+ if (parsedecl (f->retDef , &valuetype, mDefaultSignedness , mSettings ))
74917489 setValueType (tok, valuetype);
74927490 }
74937491
@@ -7501,7 +7499,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
75017499
75027500 if (Token::Match (tok, " ( %type% %type%| *| *| )" )) {
75037501 ValueType vt;
7504- if (parsedecl (tok->next (), &vt, mDefaultSignedness , mSettings , mIsCpp )) {
7502+ if (parsedecl (tok->next (), &vt, mDefaultSignedness , mSettings )) {
75057503 setValueType (tok->next (), vt);
75067504 }
75077505 }
@@ -7543,7 +7541,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
75437541 // Aggregate constructor
75447542 if (Token::Match (tok->previous (), " %name%" )) {
75457543 ValueType valuetype;
7546- if (parsedecl (tok->previous (), &valuetype, mDefaultSignedness , mSettings , mIsCpp )) {
7544+ if (parsedecl (tok->previous (), &valuetype, mDefaultSignedness , mSettings )) {
75477545 if (valuetype.typeScope ) {
75487546 setValueType (tok, valuetype);
75497547 continue ;
@@ -7557,7 +7555,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
75577555 if (mSettings .library .detectContainerOrIterator (typeStartToken) ||
75587556 mSettings .library .detectSmartPointer (typeStartToken)) {
75597557 ValueType vt;
7560- if (parsedecl (typeStartToken, &vt, mDefaultSignedness , mSettings , mIsCpp )) {
7558+ if (parsedecl (typeStartToken, &vt, mDefaultSignedness , mSettings )) {
75617559 setValueType (tok, vt);
75627560 continue ;
75637561 }
@@ -7567,7 +7565,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
75677565
75687566 if ((e == " std::make_shared" || e == " std::make_unique" ) && Token::Match (tok->astOperand1 (), " :: %name% < %name%" )) {
75697567 ValueType vt;
7570- parsedecl (tok->astOperand1 ()->tokAt (3 ), &vt, mDefaultSignedness , mSettings , mIsCpp );
7568+ parsedecl (tok->astOperand1 ()->tokAt (3 ), &vt, mDefaultSignedness , mSettings );
75717569 if (vt.typeScope ) {
75727570 vt.smartPointerType = vt.typeScope ->definedType ;
75737571 vt.typeScope = nullptr ;
@@ -7596,7 +7594,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
75967594 std::istringstream istr (typestr+" ;" );
75977595 tokenList.createTokens (istr, tok->isCpp () ? Standards::Language::CPP : Standards::Language::C);
75987596 tokenList.simplifyStdType ();
7599- if (parsedecl (tokenList.front (), &valuetype, mDefaultSignedness , mSettings , mIsCpp )) {
7597+ if (parsedecl (tokenList.front (), &valuetype, mDefaultSignedness , mSettings )) {
76007598 valuetype.originalTypeName = typestr;
76017599 setValueType (tok, valuetype);
76027600 }
@@ -7688,7 +7686,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
76887686 ValueType vt;
76897687 tokenList.simplifyPlatformTypes ();
76907688 tokenList.simplifyStdType ();
7691- if (parsedecl (tokenList.front (), &vt, mDefaultSignedness , mSettings , mIsCpp )) {
7689+ if (parsedecl (tokenList.front (), &vt, mDefaultSignedness , mSettings )) {
76927690 vt.originalTypeName = typestr;
76937691 setValueType (tok, vt);
76947692 }
@@ -7761,7 +7759,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
77617759 fscope = fscope->nestedIn ;
77627760 if (fscope && fscope->function && fscope->function ->retDef ) {
77637761 ValueType vt;
7764- parsedecl (fscope->function ->retDef , &vt, mDefaultSignedness , mSettings , mIsCpp );
7762+ parsedecl (fscope->function ->retDef , &vt, mDefaultSignedness , mSettings );
77657763 setValueType (tok, vt);
77667764 }
77677765 } else if (tok->isKeyword () && tok->str () == " this" && tok->scope ()->isExecutable ()) {
@@ -7803,7 +7801,7 @@ void SymbolDatabase::setValueTypeInTokenList(bool reportDebugWarnings, Token *to
78037801ValueType ValueType::parseDecl (const Token *type, const Settings &settings)
78047802{
78057803 ValueType vt;
7806- parsedecl (type, &vt, settings.platform .defaultSign == ' u' ? Sign::UNSIGNED : Sign::SIGNED, settings, type-> isCpp () );
7804+ parsedecl (type, &vt, settings.platform .defaultSign == ' u' ? Sign::UNSIGNED : Sign::SIGNED, settings);
78077805 return vt;
78087806}
78097807
0 commit comments