analysis: Allow multiple events of the same name

Fixes #1215
This commit is contained in:
Yoichi Hirai 2016-10-18 14:52:27 +02:00
parent 5a56496db9
commit 08015590f2
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -58,6 +58,13 @@ Declaration const* DeclarationContainer::conflictingDeclaration(
return declaration;
}
}
else if (dynamic_cast<EventDefinition const*>(&_declaration))
{
// check that all other declarations with the same name are events
for (Declaration const* declaration: declarations)
if (!dynamic_cast<EventDefinition const*>(declaration))
return declaration;
}
else if (declarations.size() == 1 && declarations.front() == &_declaration)
return nullptr;
else if (!declarations.empty())