File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ static std::string unhandledElement(const QXmlStreamReader &xmlReader)
3535 throw std::runtime_error (QObject::tr (" line %1: Unhandled element %2" ).arg (xmlReader.lineNumber ()).arg (xmlReader.name ().toString ()).toStdString ());
3636}
3737
38+ static std::string mandatoryAttibuteMissing (const QXmlStreamReader &xmlReader, QString attributeName)
39+ {
40+ throw std::runtime_error (QObject::tr (" line %1: Mandatory attribute '%2' missing in '%3'" )
41+ .arg (xmlReader.lineNumber ())
42+ .arg (attributeName)
43+ .arg (xmlReader.name ().toString ()).toStdString ());
44+ }
45+
3846static CppcheckLibraryData::Container loadContainer (QXmlStreamReader &xmlReader)
3947{
4048 CppcheckLibraryData::Container container;
@@ -232,6 +240,9 @@ static CppcheckLibraryData::PodType loadPodType(const QXmlStreamReader &xmlReade
232240{
233241 CppcheckLibraryData::PodType podtype;
234242 podtype.name = xmlReader.attributes ().value (" name" ).toString ();
243+ if (podtype.name .isEmpty ()) {
244+ mandatoryAttibuteMissing (xmlReader, " name" );
245+ }
235246 podtype.stdtype = xmlReader.attributes ().value (" stdtype" ).toString ();
236247 podtype.size = xmlReader.attributes ().value (" size" ).toString ();
237248 podtype.sign = xmlReader.attributes ().value (" sign" ).toString ();
You can’t perform that action at this time.
0 commit comments