Fixed false positive in self check
This commit is contained in:
parent
b0ac92ce8f
commit
b2691bda88
|
@ -2844,6 +2844,9 @@ Check::FileInfo *CheckClass::getFileInfo(const Tokenizer *tokenizer, const Setti
|
||||||
// One definition rule
|
// One definition rule
|
||||||
std::vector<MyFileInfo::NameLoc> classDefinitions;
|
std::vector<MyFileInfo::NameLoc> classDefinitions;
|
||||||
for (const Scope * classScope : tokenizer->getSymbolDatabase()->classAndStructScopes) {
|
for (const Scope * classScope : tokenizer->getSymbolDatabase()->classAndStructScopes) {
|
||||||
|
if (classScope->isAnonymous())
|
||||||
|
continue;
|
||||||
|
|
||||||
// the full definition must be compared
|
// the full definition must be compared
|
||||||
bool fullDefinition = std::all_of(classScope->functionList.begin(),
|
bool fullDefinition = std::all_of(classScope->functionList.begin(),
|
||||||
classScope->functionList.end(),
|
classScope->functionList.end(),
|
||||||
|
|
|
@ -1029,6 +1029,11 @@ public:
|
||||||
|
|
||||||
std::vector<Enumerator> enumeratorList;
|
std::vector<Enumerator> enumeratorList;
|
||||||
|
|
||||||
|
bool isAnonymous() const {
|
||||||
|
// TODO: Check if class/struct is anonymous
|
||||||
|
return className.size() > 9 && className.compare(0,9,"Anonymous") == 0 && std::isdigit(className[9]);
|
||||||
|
}
|
||||||
|
|
||||||
const Enumerator * findEnumerator(const std::string & name) const {
|
const Enumerator * findEnumerator(const std::string & name) const {
|
||||||
for (const Enumerator & i : enumeratorList) {
|
for (const Enumerator & i : enumeratorList) {
|
||||||
if (i.name->str() == name)
|
if (i.name->str() == name)
|
||||||
|
|
Loading…
Reference in New Issue