From b6cba4a55c5c57d887fb09b1b50249bbc44601bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 26 Nov 2016 22:39:47 +0100 Subject: [PATCH] Fixed #7784 (Token: can't be both type and variable) --- lib/token.h | 6 ++++-- test/testtoken.cpp | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/token.h b/lib/token.h index 298933937..653b9728b 100644 --- a/lib/token.h +++ b/lib/token.h @@ -492,10 +492,12 @@ public: } void varId(unsigned int id) { _varId = id; - if (id != 0) + if (id != 0) { _tokType = eVariable; - else + isStandardType(false); + } else { update_property_info(); + } } /** diff --git a/test/testtoken.cpp b/test/testtoken.cpp index 34ae0f9c6..fe049dafe 100644 --- a/test/testtoken.cpp +++ b/test/testtoken.cpp @@ -830,6 +830,12 @@ private: // Change back to standard type tok.str("int"); ASSERT_EQUALS(true, tok.isStandardType()); + + // token can't be both type and variable + tok.str("abc"); + tok.isStandardType(true); + tok.varId(123); + ASSERT_EQUALS(false, tok.isStandardType()); } void updateProperties() const {