@@ -1043,11 +1043,8 @@ void CheckClass::checkMemset()
10431043 if (typeTok && typeTok->str () == " (" )
10441044 typeTok = typeTok->next ();
10451045
1046- if (!type) {
1047- const Type* t = symbolDatabase->findVariableType (scope, typeTok);
1048- if (t)
1049- type = t->classScope ;
1050- }
1046+ if (!type && typeTok->type ())
1047+ type = typeTok->type ()->classScope ;
10511048
10521049 if (type) {
10531050 std::list<const Scope *> parsedTypes;
@@ -1693,7 +1690,7 @@ void CheckClass::checkConst()
16931690 } else {
16941691 // don't warn for unknown types..
16951692 // LPVOID, HDC, etc
1696- if (previous->isUpperCaseName () && previous-> str ().size () > 2 && !symbolDatabase-> isClassOrStruct ( previous->str () ))
1693+ if (previous->str ().size () > 2 && !previous-> type () && previous->isUpperCaseName ( ))
16971694 continue ;
16981695 }
16991696
@@ -1854,13 +1851,13 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool&
18541851 const Token* lhs = tok1->tokAt (-1 );
18551852 if (lhs->str () == " &" ) {
18561853 lhs = lhs->previous ();
1857- if (lhs->type () == Token::eAssignmentOp && lhs->previous ()->variable ()) {
1854+ if (lhs->tokType () == Token::eAssignmentOp && lhs->previous ()->variable ()) {
18581855 if (lhs->previous ()->variable ()->typeStartToken ()->strAt (-1 ) != " const" && lhs->previous ()->variable ()->isPointer ())
18591856 return false ;
18601857 }
18611858 } else {
18621859 const Variable* v2 = lhs->previous ()->variable ();
1863- if (lhs->type () == Token::eAssignmentOp && v2)
1860+ if (lhs->tokType () == Token::eAssignmentOp && v2)
18641861 if (!v2->isConst () && v2->isReference () && lhs == v2->nameToken ()->next ())
18651862 return false ;
18661863 }
@@ -1900,7 +1897,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool&
19001897 }
19011898
19021899 // Assignment
1903- else if (end->next ()->type () == Token::eAssignmentOp)
1900+ else if (end->next ()->tokType () == Token::eAssignmentOp)
19041901 return (false );
19051902
19061903 // Streaming
@@ -1910,7 +1907,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func, bool&
19101907 return (false );
19111908
19121909 // ++/--
1913- else if (end->next ()->type () == Token::eIncDecOp || tok1->previous ()->type () == Token::eIncDecOp)
1910+ else if (end->next ()->tokType () == Token::eIncDecOp || tok1->previous ()->tokType () == Token::eIncDecOp)
19141911 return (false );
19151912
19161913
0 commit comments