diff options
author | Marco Bubke <marco.bubke@qt.io> | 2018-11-22 14:37:51 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2018-11-27 08:51:35 +0000 |
commit | 15df73a8ba287a995353a6eb8526bfdbf46561bf (patch) | |
tree | c1f7dfa20c904da912fb5b72b2ed2150f3c60d89 /tests | |
parent | a84a8518145b1dd3b027527cb225003b32622cd9 (diff) |
Clang: Fix output arguments highlighting for constructor parameters
The are not any more shown but they are still not shown for constructor
arguments because libClang is providing the wrong argument count.
Task-number: QTCREATORBUG-21543
Change-Id: If9b6140ed4b2dedf71bd94aae0a97669cdd04e67
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/unittest/data/highlightingmarks.cpp | 12 | ||||
-rw-r--r-- | tests/unit/unittest/tokenprocessor-test.cpp | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/unittest/data/highlightingmarks.cpp b/tests/unit/unittest/data/highlightingmarks.cpp index 7748ff17a0..e1a48903ca 100644 --- a/tests/unit/unittest/data/highlightingmarks.cpp +++ b/tests/unit/unittest/data/highlightingmarks.cpp @@ -674,3 +674,15 @@ int signalSlotTest() { SIGNAL(something(QString (*func1)(QString))); 1 == 2; } + +class NonConstParameterConstructor +{ + NonConstParameterConstructor() = default; + NonConstParameterConstructor(NonConstParameterConstructor &buildDependenciesStorage); + + void Call() + { + NonConstParameterConstructor foo; + NonConstParameterConstructor bar(foo); + } +}; diff --git a/tests/unit/unittest/tokenprocessor-test.cpp b/tests/unit/unittest/tokenprocessor-test.cpp index 2935a85381..f48d546cb1 100644 --- a/tests/unit/unittest/tokenprocessor-test.cpp +++ b/tests/unit/unittest/tokenprocessor-test.cpp @@ -1679,6 +1679,24 @@ TEST_F(TokenProcessor, QtOldStyleSignalFunctionPointerType) ASSERT_THAT(infos[10], HasOnlyType(HighlightingType::Type)); } +TEST_F(TokenProcessor, NonConstParameterConstructor) +{ + const auto infos = translationUnit.tokenInfosInRange(sourceRange(681, 90)); + + infos[1]; + + ASSERT_THAT(infos[4], Not(HasMixin(HighlightingType::OutputArgument))); +} + +TEST_F(TokenProcessor, DISABLED_NonConstArgumentConstructor) +{ + const auto infos = translationUnit.tokenInfosInRange(sourceRange(686, 47)); + + infos[2]; + + ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument)); +} + Data *TokenProcessor::d; void TokenProcessor::SetUpTestCase() |