From be7b104a8e3e6a67f3f7e891aff1e7bc932da216 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sat, 19 May 2012 01:51:47 -0700 Subject: [PATCH] Added missing checks to CheckClass::classInfo() Replaced tokAt(1) with next() in checkother.cpp --- lib/checkclass.h | 8 ++++++-- lib/checkother.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/checkclass.h b/lib/checkclass.h index 24c60a379..7c09678aa 100644 --- a/lib/checkclass.h +++ b/lib/checkclass.h @@ -152,12 +152,16 @@ private: return "Check the code for each class.\n" "* Missing constructors\n" "* Are all variables initialized by the constructors?\n" + "* Are all variables assigned by 'operator='?\n" "* Warn if memset, memcpy etc are used on a class\n" "* If it's a base class, check that the destructor is virtual\n" - "* Are there unused private functions\n" + "* Are there unused private functions?\n" "* 'operator=' should return reference to self\n" "* 'operator=' should check for assignment to self\n" - "* Constness for member functions\n"; + "* Constness for member functions\n" + "* Order of initalizations\n" + "* Suggest usage of initalization list\n" + "* Suspicious subtraction from 'this'\n"; } // operatorEqRetRefThis helper function diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 922c3f504..9ccd98970 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -1750,7 +1750,7 @@ void CheckOther::checkUnreachableCode() } } else if (Token::Match(tok, "goto %any% ;")) { secondBreak = tok->tokAt(3); - labelName = tok->tokAt(1); + labelName = tok->next(); } // Statements follow directly, no line between them. (#3383)