From f19facd37842de97f2330e3a34c2bdfc3552dea9 Mon Sep 17 00:00:00 2001
From: Nikolai Kosjar <nikolai.kosjar@qt.io>
Date: Fri, 16 Jun 2017 09:16:22 +0200
Subject: [PATCH] Clang: Add more CLANG-UPGRADE-CHECK markers

Change-Id: I9ee553f29fa7a7f60291e2d7d2a56062dc722b9d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
---
 qbs/modules/libclang/functions.js               | 2 +-
 src/plugins/cpptools/compileroptionsbuilder.cpp | 4 ++--
 tests/unit/unittest/highlightingmarks-test.cpp  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/qbs/modules/libclang/functions.js b/qbs/modules/libclang/functions.js
index 17d1bc4f9a6..3de3af18954 100644
--- a/qbs/modules/libclang/functions.js
+++ b/qbs/modules/libclang/functions.js
@@ -1,7 +1,7 @@
 var Environment = require("qbs.Environment")
 var File = require("qbs.File")
 var FileInfo = require("qbs.FileInfo")
-var MinimumLLVMVersion = "3.9.0"
+var MinimumLLVMVersion = "3.9.0" // CLANG-UPGRADE-CHECK: Adapt minimum version numbers.
 var Process = require("qbs.Process")
 
 function readOutput(executable, args)
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index 88a85e17cda..fc1aa534d0b 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -237,14 +237,14 @@ void CompilerOptionsBuilder::addOptionsForLanguage(bool checkForBorlandExtension
         opts << (gnuExtensions ? QLatin1String("-std=gnu++98") : QLatin1String("-std=c++98"));
         break;
     case ProjectPart::CXX03:
-        // Clang 3.6 does not know -std=gnu++03.
+        // CLANG-UPGRADE-CHECK: Clang 3.6/3.9 does not know -std=gnu++03, but 5.0 does.
         opts << QLatin1String("-std=c++03");
         break;
     case ProjectPart::CXX14:
         opts << (gnuExtensions ? QLatin1String("-std=gnu++14") : QLatin1String("-std=c++14"));
         break;
     case ProjectPart::CXX17:
-        // TODO: Change to (probably) "gnu++17"/"c++17" at some point in the future.
+        // CLANG-UPGRADE-CHECK: Change to "gnu++17"/"c++17" for clang 5.0.
         opts << (gnuExtensions ? QLatin1String("-std=gnu++1z") : QLatin1String("-std=c++1z"));
         break;
     }
diff --git a/tests/unit/unittest/highlightingmarks-test.cpp b/tests/unit/unittest/highlightingmarks-test.cpp
index 1aeeb734feb..1fd806f99d8 100644
--- a/tests/unit/unittest/highlightingmarks-test.cpp
+++ b/tests/unit/unittest/highlightingmarks-test.cpp
@@ -1169,7 +1169,7 @@ TEST_F(HighlightingMarks, PreprocessorInclusionDirectiveWithKeyword)
     ASSERT_THAT(infos[3], HasOnlyType(HighlightingType::StringLiteral));
 }
 
-// This test should pass once https://bugs.llvm.org//show_bug.cgi?id=12972 is resolved.
+// CLANG-UPGRADE-CHECK: Enable once https://bugs.llvm.org//show_bug.cgi?id=12972 is resolved.
 TEST_F(HighlightingMarks, DISABLED_VariableInOperatorFunctionCall)
 {
     const auto infos = translationUnit.highlightingMarksInRange(sourceRange(566, 12));
-- 
GitLab