Index: outputview/outputformats.h =================================================================== --- outputview/outputformats.h +++ outputview/outputformats.h @@ -40,6 +40,9 @@ int textGroup; QString compiler; + // Returns the column number starting with 0 as the first column + // If no match was found for columns or if index was not valid + // (i.e. less than zero) - 0 is returned. int columnNumber(const QRegularExpressionMatch& match) const; }; Index: outputview/outputformats.cpp =================================================================== --- outputview/outputformats.cpp +++ outputview/outputformats.cpp @@ -49,7 +49,9 @@ int ErrorFormat::columnNumber(const QRegularExpressionMatch& match) const { - return columnGroup >= 0 ? match.captured( columnGroup ).toInt() - 1 : 0; + if(columnGroup < 0) return 0; + int columnNumberFromApp = match.captured( columnGroup ).toInt() - 1; + return columnNumberFromApp >= 0 ? columnNumberFromApp : 0; } } Index: outputview/tests/test_filteringstrategy.cpp =================================================================== --- outputview/tests/test_filteringstrategy.cpp +++ outputview/tests/test_filteringstrategy.cpp @@ -447,6 +447,9 @@ QTest::newRow("gcc-no-col") << "/path/to/file.cpp:123: error ..." << "/path/to/file.cpp" << 122 << 0 << FilteredItem::ErrorItem; + QTest::newRow("gcc-app-gives-invalid-column") + << "/path/to/file.h:60:0:\ +warning: \"SOME_MACRO\" redefined" << "/path/to/file.h" << 59 << 0 << FilteredItem::WarningItem; QTest::newRow("fortcom") << "fortcom: Error: Ogive8.f90, line 123: ..." << QString(projectPath() + "/Ogive8.f90") << 122 << 0 << FilteredItem::ErrorItem;