diff --git a/CheckClass.cpp b/CheckClass.cpp index dee11bd5d..4050c0ca8 100644 --- a/CheckClass.cpp +++ b/CheckClass.cpp @@ -20,6 +20,20 @@ struct VAR static struct VAR *ClassChecking_GetVarList(const char classname[]) { + // Get all initialized types.. + std::vector InitializedTypes; + for (TOKEN *tok = tokens; tok; tok = tok->next) + { + // "typedef std::" => This is a initialized type + if (match(tok,"typedef std ::")) + { + while (tok->next && tok->next->str[0]!=';') + tok = tok->next; + InitializedTypes.push_back(tok->str); + continue; + } + } + // Locate class.. const char *pattern[] = {"class","","{",0}; pattern[1] = classname; @@ -68,7 +82,12 @@ static struct VAR *ClassChecking_GetVarList(const char classname[]) is_class |= (strcmp(c->name, tok->str) == 0); } - if (match(tok,"std ::")) + bool initializedtype = false; + for (unsigned int i = 0; i < InitializedTypes.size(); i++) + initializedtype |= (strcmp(tok->str,InitializedTypes[i])==0); + + // "std::" => This variable is initialized + if (match(tok,"std ::") || initializedtype) { while (tok->next && tok->next->str[0] != ';') tok = tok->next; diff --git a/testclass14/err.msg b/testclass14/err.msg new file mode 100644 index 000000000..e69de29bb diff --git a/testclass14/testclass14.cpp b/testclass14/testclass14.cpp new file mode 100644 index 000000000..474c7a938 --- /dev/null +++ b/testclass14/testclass14.cpp @@ -0,0 +1,15 @@ + + +class Kalle +{ +private: + typedef std::vector ints; + ints i; +public: + Kalle(); +}; + +Kalle::Kalle() +{ + +}