summaryrefslogtreecommitdiff
path: root/tests/auto/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
* CPlusPlus: Add parser support for generic lambdasChristian Kandeler2023-03-131-0/+29
| | | | | | Change-Id: Id17975a4296925c10b1b43f963412eea61ccfa5d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add support for coroutinesChristian Kandeler2023-03-061-2/+182
| | | | | | | | | Also fix some concept-related bugs uncovered by the test case. Change-Id: Ia67c971026bcd85d9cc252f46cd4f56c2865d432 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Support requires clause in parserChristian Kandeler2023-03-031-0/+23
| | | | | | | Change-Id: Ice6a7a287453516a1cfc296e2c9f16160b3ea130 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Handle C++20 concepts in parserChristian Kandeler2023-02-281-0/+25
| | | | | | | Change-Id: I8c6b8b1ba3f36b83cd1d667bec9830271147b1ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge remote-tracking branch 'origin/10.0'Eike Ziller2023-02-101-1/+1
|\ | | | | | | | | | | | | Conflicts: src/plugins/clangcodemodel/clangdlocatorfilters.cpp Change-Id: If91f26625ea9620fb9fdbf45705b32f37cb7f158
| * CPlusPlus: Check maximum include depth in lexerChristian Kandeler2023-02-081-1/+1
| | | | | | | | | | | | | | | | We use a value of 200, which is also GCC's default. Fixes: QTCREATORBUG-28770 Change-Id: Id02b324cd2ffa81a709441a5d93856bcd06501c3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CPlusPlus: Add lexer support for new C++20 keywordsChristian Kandeler2023-02-091-0/+33
|/ | | | | Change-Id: I2b83deb0502ebf2cdca2af774fbb2ce26e947c11 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Cpp: support space ship operator in lexerDavid Schulz2023-01-301-0/+2
| | | | | | Fixes: QTCREATORBUG-27503 Change-Id: Idbff5a9b5b2e6e841e298ca6f706ef3c6aa1622b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove GPL-3.0+ from license identifiersKai Köhne2023-01-0617-17/+17
| | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* tests: Remove foreach usageArtem Sokolovskii2023-01-033-13/+13
| | | | | | Task-number: QTCREATORBUG-27464 Change-Id: I0e42da9b04793be959ad050fdecc0c78c98d9fcd Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppEditor: More migration to FilePathhjk2022-12-141-1/+1
| | | | | Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CplusPlus: Pass FilePath to Preprocessor::run()hjk2022-12-072-4/+4
| | | | | | | | | | ... and update caller sides. Change-Id: I6a107e4a7fd9f7123cdc6f141da202845bcbbb66 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Use FilePath for resolved include pathshjk2022-11-301-3/+3
| | | | | | | | ... and fix fallout. Change-Id: I66886e91ff476eff15db51cc024a8021e952d44d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Tests: Replace foreach with range-based for loopsJarek Kobus2022-11-241-1/+1
| | | | | | Change-Id: If813702db78f05701f0ef9378843a474da0aae6a Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* CppEditor: Proliferate FilePath usehjk2022-11-248-10/+14
| | | | | | | | | | | This includes one functional change: It drops some cleaning of the path used to create the CppDocument, which is now assumed to be done on the caller side. Change-Id: I5e2a182028e4d5b56282ad85f4a5c665f081754f Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppEditor: Let users check for unused functions in (sub-)projectsChristian Kandeler2022-11-241-5/+5
| | | | | | | | | | | | | | | | | | | | Note that especially in C++, there can be a lot of false positives, especially in template-heavy code bases. We filter out the most notorious offenders, namely: - templates themselves - constructors and destructors - *begin() and *end() - qHash() - main() Since the code model does not know about symbol visibility, the functionality is quite useless for libraries, unless you want to check your test coverage. The procedure is rather slow, but that shouldn't matter so much, as it's something you'll only run "once in a while". Fixes: QTCREATORBUG-6772 Change-Id: If00a537b760a9b0babdda6c848133715c3240155 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Proliferate FilePath usehjk2022-11-223-5/+11
| | | | | | | | | | | | | | | | | | | The starts with CppDocument::filePath(), plus a bit of the fallout This is one patch of potentially many. It is hard to draw the line where to stop this kind of chunk, this here converts a few additional functions for which including it in the patch looked like less churn than without. Converting is mostly fromString/toString, with a few exceptions for "already seem" like caches, that use cheaper "path()" to avoid likely performance regressions (on Windows FilePath comparison is currently case-insenstive, and more expensive). There should be no difference for local operation with this patch. Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Add new usage tag "Template"Christian Kandeler2022-11-171-4/+6
| | | | | | | For use in follow-up patch. Change-Id: I49c057280be9b09862a89fa385a7396f1b1093bb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add more usage tagsChristian Kandeler2022-11-071-1/+144
| | | | | | | To be used in subsequent patches. Change-Id: Id7140aa39bb2adba343cc12b0273c90f3c12abeb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Make Usage::Type QFlags-basedChristian Kandeler2022-11-071-233/+235
| | | | | | | | We want to extend the enum with more non-exclusive values. Change-Id: I4d8ebe1f7327139c7817b9f621b4b74a883c5e09 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Allow " = default" also on function implementationsChristian Kandeler2022-10-241-1/+3
| | | | | | | | | | | Note that we only make sure not to trip over valid code; we make no effort to check whether default/delete is actually allowed at this type of declaration. Fixes: QTCREATORBUG-28102 Change-Id: Ic693319b9dfaf8652cf4cae9cd907a6e258ad773 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Use SPDX license identifiersLucie Gérard2022-08-2617-408/+34
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* CPlusPlus: Support structured bindingsChristian Kandeler2022-08-231-0/+37
| | | | | | | | | | While we do recommend clangd for modern code bases, we should still be able to parse basic language constructs. Fixes: QTCREATORBUG-27975 Change-Id: I189b991685a5cd5f62f2afce77878b60c895e8f9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* CPlusPlus: Remove Rreprocessor::run overload for QStringshjk2022-08-011-1/+1
| | | | | | | | | | The preprocessor operates on QByteArray, making it less convenient to use strings helps preventing accidental conversion roundtrips. Change-Id: Ifb2068a8fed137c52b05f2979b99cbce3462151e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline more simple Type related functionshjk2022-06-283-19/+19
| | | | | Change-Id: I2103e8047b385b438e58072e8a2689f1889d2724 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some simple central functionshjk2022-06-241-3/+3
| | | | | | | | | | | | | Depending on context, callgrind sees contributions of >8% to the total cost of project parsing for these functions. The functional are actualy executed executed out-of-line, often for a function body of one "payload" instruction only. Inlining removes the call/endbr64/ret overhead. Change-Id: I6886f08e322fcaa4e0f54d424279e0a8c24e4718 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Use QTEST_GUILESS_MAIN where applicableEike Ziller2022-06-135-5/+5
| | | | | | | | | | instead of QTEST_MAIN. Reduces the initialization that is done by the Qt test applications, and can also reduce interference with normal OS operations like the current window loosing focus. Change-Id: If88f289281aa1c8703ac7d4dbe0799d067c16588 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CppEditor: Fix indentation for structured bindingGPery2022-03-291-0/+12
| | | | | | | | | | Structured bindings were parsed as lambdas instead Fixes: QTCREATORBUG-27183 Change-Id: I3c88dc1012e55edfe417504c17f6138e3356651c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove qmake build filesEike Ziller2022-01-2017-107/+0
| | | | | | | | | | Removes qmake as a build system for building Qt Creator itself. Keep them for some tests that are not completely moved to CMake yet. Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Fix "Find references"Christian Kandeler2021-11-091-0/+40
| | | | | | | | | ... for certain types of template/namespace combinations. This essentially reverts 2798c11d1d. Fixes: QTCREATORBUG-26520 Change-Id: I1ab0e4e19bd09695d1536bf6f10960107e9ecbc4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: Add highlighting category for namespacesChristian Kandeler2021-10-291-25/+26
| | | | | | | | ... and make use of it in the built-in code model and with clangd. Task-number: QTCREATORBUG-16580 Change-Id: I8c331f56aa1bbf91c9f768be82a779a72f40c4c7 Reviewed-by: David Schulz <david.schulz@qt.io>
* TextEditor: Allow special highlighting for static membersChristian Kandeler2021-10-281-15/+18
| | | | | | Task-number: QTCREATORBUG-9659 Change-Id: Idae529fd876ba5f555c76e4d282efc9263263d6c Reviewed-by: David Schulz <david.schulz@qt.io>
* CppEditor: Remove an unused enum valueChristian Kandeler2021-09-211-1/+0
| | | | | Change-Id: Ifd0361a9a78eae7be917e1fff68161aa0cd8e79f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Merge CppTools into CppEditorChristian Kandeler2021-09-0121-30/+30
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Utils: Introduce a FilePath constructor from char arrayshjk2021-08-171-1/+1
| | | | | | | | | | | | Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for decorations in user code. At the same time, drop some convenience constructors and functions in CommandLine and Icon essentially serving the same purpose. Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Turn some classes into pure value typesChristian Kandeler2021-08-133-1/+3
| | | | | | | | | | | | | ProjectInfo, ProjectPart and ProjectUpdateInfo used to carry pointers to Project and/or Toolchain, even though they were used in contexts where these pointers were either unsafe to access or not guaranteed to be valid anymore, which made their use difficult and error-prone. We turn these classes into pure value types by copying in all relevant information before the first async operation takes place. Fixes: QTCREATORBUG-25678 Change-Id: I1914b0dbda6c7dfba6c95e5e92f2d69977755590 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* CppEditor: Add second "Find References" ActionChristian Kandeler2021-06-071-41/+41
| | | | | | | | | | This one includes access type categorization, while the "normal" one does not. We need this now, because with clangd, the categorization is too slow to enable it by default. Change-Id: I2eb4608630d34452ae28f0836befd5d9053f42bf Reviewed-by: David Schulz <david.schulz@qt.io>
* Lexer: Support the integer suffixes LU and LLU alsoAndre Hartmann2021-04-191-0/+44
| | | | | | | | | | Before we only supported UL and ULL. And add tests for all variants of allowed integer suffixes. Fixes: QTCREATORBUG-25604 Change-Id: Id92f371d2effa7456d2d50891a6c29810c5c4c75 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Do not mis-classify bitfield declarations as initializationsChristian Kandeler2021-02-251-1/+1
| | | | | | Fixes: QTCREATORBUG-25390 Change-Id: I1976b7db2996f5a09db73adbd127aac9ab92d57d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add missing line and column info for lambda functionshjk2021-02-051-0/+12
| | | | | | Task-number: QTCREATORBUG-25242 Change-Id: I5032bb04879e30f5516471e2038dc4b6bb3477f8 Reviewed-by: hjk <hjk@qt.io>
* Merge remote-tracking branch 'origin/4.14'Eike Ziller2020-12-031-1/+17
|\ | | | | | | Change-Id: Id4c4c06b086dfe38960f4d68694ae23f3e00109f
| * CPlusPlus: Fix mis-classification of pure virtualsChristian Kandeler2020-12-031-1/+17
| | | | | | | | | | | | | | | | Syntactically, they do have an initializer, but they are not initializations. Change-Id: I0556b279ce2d173868585cbce085b803c1cff285 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CPlusPlus: Support C++11 attributes also for function parametersChristian Kandeler2020-11-121-1/+1
| | | | | | | | | | | | Fixes: QTCREATORBUG-24636 Change-Id: I9dc3d2cc6ca102b09f6b040455fa901c362dae7d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | CPlusPlus: Expose "static" specifier also for function declarationsChristian Kandeler2020-11-111-1/+0
| | | | | | | | | | | | | | | | | | | | To be able to do this, the parser needs to store the decl specifier list in FunctionDeclaratorAST objects, the same way it is done for FunctionDefinitionAST. Task-number: QTCREATORBUG-24894 Change-Id: I475fb08b1f14c63f3050d72dff200c1b08df5789 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* | Merge remote-tracking branch 'origin/4.14'Eike Ziller2020-11-102-35/+89
|\ \ | |/ | | | | Change-Id: I2ae0eb18782224e48cd20d41907f9dfea6ee1771
| * CPlusPlus: Fix "find usages" categorization for sizeof and array accessChristian Kandeler2020-11-091-3/+29
| | | | | | | | | | | | Task-number: QTCREATORBUG-24894 Change-Id: I65fa097785b19e181f15178ad6d30608899316c0 Reviewed-by: André Hartmann <aha_1980@gmx.de>
| * CPlusPlus: Provide information about the "static" specifierChristian Kandeler2020-11-091-1/+0
| | | | | | | | | | | | | | | | | | | | ... to the function type. This fixes the issue for function *definitions*. For function *declarations*, we need to amend the parser. Task-number: QTCREATORBUG-24894 Change-Id: I02043d8b974c2c64dcd739c7e05ce44fd277b5d3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * CPlusPlus: Check for static member functions in FindUsagesChristian Kandeler2020-11-091-3/+10
| | | | | | | | | | | | | | | | | | | | | | Static member functions cannot modify the object and therefore must not be reported as writable references. Note that this does not have an effect yet, as the function type lacks information about the "static" specifier. Task-number: QTCREATORBUG-24894 Change-Id: Ib04a17864a0ca5b7610579a2f5efbcfde257e08a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
| * CPlusPlus: Correctly categorize post-increment and -decrement accessesChristian Kandeler2020-11-041-2/+8
| | | | | | | | | | Change-Id: Id21c13ea58f6747c226d91aff2b00c3409faa880 Reviewed-by: André Hartmann <aha_1980@gmx.de>
| * CPlusPlus: Differentiate declarations with an initializerChristian Kandeler2020-11-041-13/+13
| | | | | | | | | | | | | | | | ... from those without one, and display the former like write accesses. Task-number: QTCREATORBUG-24894 Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb Reviewed-by: André Hartmann <aha_1980@gmx.de>