From c76c8df101758698b6cab0cda3ee974755d58f87 Mon Sep 17 00:00:00 2001 From: Tobias Hunger <tobias.hunger@digia.com> Date: Thu, 25 Apr 2013 16:48:15 +0200 Subject: [PATCH] GccParser: Fix parsing of header files without extension Change-Id: I4f0cc028814c0abf2ecae62aee6b38cc3e75f895 Reviewed-by: Orgad Shaneh <orgads@gmail.com> --- src/plugins/projectexplorer/gccparser.cpp | 33 ++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index d1238f6a34a..c31f93e0e4e 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -35,7 +35,7 @@ using namespace ProjectExplorer; // opt. drive letter + filename: (2 brackets) -static const char FILE_PATTERN[] = "(<command[ -]line>|([A-Za-z]:)?[^:]+\\.[^:]+):"; +static const char FILE_PATTERN[] = "(<command[ -]line>|([A-Za-z]:)?[^:]+):"; static const char COMMAND_PATTERN[] = "^(.*[\\\\/])?([a-z0-9]+-[a-z0-9]+-[a-z0-9]+-)?(gcc|g\\+\\+)(-[0-9\\.]+)?(\\.exe)?: "; GccParser::GccParser() @@ -784,6 +784,37 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() categoryCompile)) << QString(); + QTest::newRow("qtcreatorbug-9195") + << QString::fromLatin1("In file included from /usr/include/qt4/QtCore/QString:1:0,\n" + " from main.cpp:3:\n" + "/usr/include/qt4/QtCore/qstring.h: In function 'void foo()':\n" + "/usr/include/qt4/QtCore/qstring.h:597:5: error: 'QString::QString(const char*)' is private\n" + "main.cpp:7:22: error: within this context") + << OutputParserTester::STDERR + << QString() << QString() + << ( QList<ProjectExplorer::Task>() + << Task(Task::Unknown, + QLatin1String("In file included from /usr/include/qt4/QtCore/QString:1:0,"), + Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/QString")), 1, + categoryCompile) + << Task(Task::Unknown, + QLatin1String("from main.cpp:3:"), + Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 3, + categoryCompile) + << Task(Task::Unknown, + QLatin1String("In function 'void foo()':"), + Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), -1, + categoryCompile) + << Task(Task::Error, + QLatin1String("'QString::QString(const char*)' is private"), + Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), 597, + categoryCompile) + << Task(Task::Error, + QLatin1String("within this context"), + Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 7, + categoryCompile)) + << QString(); + } void ProjectExplorerPlugin::testGccOutputParsers() -- GitLab