From dd4235eb35d9651f7a8eb59dfc82d12f8e5709c4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 14 Mar 2023 09:53:03 +0100 Subject: [PATCH] CppEditor: Verify proper highlighting of the concept keyword Change-Id: I1c814da472f10539f87640a52822b188b9b7a2cd Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: David Schulz --- src/plugins/cppeditor/cpphighlighter.cpp | 1 + src/plugins/cppeditor/testcases/highlightingtestcase.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 1f83b317ada..0f9184600b8 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -513,6 +513,7 @@ void CppHighlighterTest::test_data() QTest::newRow("struct keyword") << 25 << 1 << 25 << 6 << C_KEYWORD; QTest::newRow("operator keyword") << 26 << 5 << 26 << 12 << C_KEYWORD; QTest::newRow("type in conversion operator") << 26 << 14 << 26 << 16 << C_PRIMITIVE_TYPE; + QTest::newRow("concept keyword") << 29 << 22 << 29 << 28 << C_KEYWORD; } void CppHighlighterTest::test() diff --git a/src/plugins/cppeditor/testcases/highlightingtestcase.cpp b/src/plugins/cppeditor/testcases/highlightingtestcase.cpp index 20fa2526467..770b22e553e 100644 --- a/src/plugins/cppeditor/testcases/highlightingtestcase.cpp +++ b/src/plugins/cppeditor/testcases/highlightingtestcase.cpp @@ -25,3 +25,5 @@ template class C; struct ConversionFunction { operator int(); }; + +template concept NoConstraint = true;