diff --git a/lib/token.cpp b/lib/token.cpp index 4b4acbefe..02b32090c 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -33,6 +33,8 @@ #include #include +const std::list Token::emptyValueList; + Token::Token(Token **tokens) : tokensBack(tokens), _next(nullptr), diff --git a/lib/token.h b/lib/token.h index 09f3aad79..ac2861acd 100644 --- a/lib/token.h +++ b/lib/token.h @@ -746,8 +746,7 @@ public: } const std::list& values() const { - static const std::list emptyList; - return _values ? *_values : emptyList; + return _values ? *_values : emptyValueList; } /** @@ -925,6 +924,7 @@ private: // ValueFlow std::list* _values; + static const std::list emptyValueList; public: void astOperand1(Token *tok);