From 1f2b5954331a5bc25d083647fff4aa23b36e3936 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Jan 2015 11:46:43 -0800 Subject: [PATCH] Ignore the ICC lines about using or creating a PCH file Qt Creator has been showing them as errors, but they're little more than noise in the output. Creator still doesn't understand "remark" lines from ICC, but that's something for another day. Change-Id: Ic894fe41f92a677ddbe09beb0ea4c557edeb0547 Reviewed-by: Tobias Hunger --- .../projectexplorer/linuxiccparser.cpp | 35 +++++++++++++++++++ src/plugins/projectexplorer/linuxiccparser.h | 1 + 2 files changed, 36 insertions(+) diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 71cbfeef479..e75aeff81d8 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -61,11 +61,22 @@ LinuxIccParser::LinuxIccParser() m_caretLine.setMinimal(true); QTC_CHECK(m_caretLine.isValid()); + // ".pch/Qt5Core.pchi.cpp": creating precompiled header file ".pch/Qt5Core.pchi" + // "animation/qabstractanimation.cpp": using precompiled header file ".pch/Qt5Core.pchi" + m_pchInfoLine.setPattern(QLatin1String("^\".*\": (creating|using) precompiled header file \".*\"\n$")); + m_pchInfoLine.setMinimal(true); + QTC_CHECK(m_pchInfoLine.isValid()); + appendOutputParser(new LdParser); } void LinuxIccParser::stdError(const QString &line) { + if (m_pchInfoLine.indexIn(line) != -1) { + // totally ignore this line + return; + } + if (m_expectFirstLine && m_firstLine.indexIn(line) != -1) { // Clear out old task Task::TaskType type = Task::Unknown; @@ -143,6 +154,13 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << QList() << QString(); + QTest::newRow("pch creation") + << QString::fromLatin1("\".pch/Qt5Core.pchi.cpp\": creating precompiled header file \".pch/Qt5Core.pchi\"") + << OutputParserTester::STDERR + << QString() << QString() + << QList() + << QString(); + QTest::newRow("undeclared function") << QString::fromLatin1("main.cpp(13): error: identifier \"f\" is undefined\n" " f(0);\n" @@ -157,6 +175,23 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() Constants::TASK_CATEGORY_COMPILE)) << QString(); + // same, with PCH remark + QTest::newRow("pch use+undeclared function") + << QString::fromLatin1("\"main.cpp\": using precompiled header file \".pch/Qt5Core.pchi\"\n" + "main.cpp(13): error: identifier \"f\" is undefined\n" + " f(0);\n" + " ^\n" + "\n") + << OutputParserTester::STDERR + << QString() << QString::fromLatin1("\n") + << (QList() + << Task(Task::Error, + QLatin1String("identifier \"f\" is undefined\nf(0);"), + Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 13, + Constants::TASK_CATEGORY_COMPILE)) + << QString(); + + QTest::newRow("private function") << QString::fromLatin1("main.cpp(53): error #308: function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\n" " b.privatefunc();\n" diff --git a/src/plugins/projectexplorer/linuxiccparser.h b/src/plugins/projectexplorer/linuxiccparser.h index f6e98f2d31e..db1c86e431f 100644 --- a/src/plugins/projectexplorer/linuxiccparser.h +++ b/src/plugins/projectexplorer/linuxiccparser.h @@ -53,6 +53,7 @@ private: QRegExp m_firstLine; QRegExp m_continuationLines; QRegExp m_caretLine; + QRegExp m_pchInfoLine; bool m_expectFirstLine; int m_indent;