aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/ASTMatcher.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppEditor: Revert changes to parseExpressionStatement()Christian Kandeler2023-05-261-5/+0
| | | | | | | | | | | | | Amends c8f29b9e0148202ab1959466e14fa23411fd8214. It turns out that there are contexts where we want to parse an expression statement even with the semicolon missing (e.g. completion on incomplete code). So leave the existing functions unchanged and do the thorough check afterwards in parseIfStatement(). Change-Id: Id6209ef1abfe9d155c5b9381e6ae655cc721feb2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Add support for init statements in if conditionsChristian Kandeler2023-05-251-0/+10
| | | | | | Fixes: QTCREATORBUG-29182 Change-Id: I9b7969da694b368236246123ad0028d8e754e903 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Add parser support for generic lambdasChristian Kandeler2023-03-131-0/+20
| | | | | | 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-0/+25
| | | | | | | | | 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/+15
| | | | | | | 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/+66
| | | | | | | 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>
* CPlusPlus: Support structured bindingsChristian Kandeler2022-08-231-0/+9
| | | | | | | | | | 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>
* C++: fix built-in code model to work with shared_ptr on MSVC 2017Volodymyr Zibarov2020-05-291-0/+42
| | | | | | | | | | | | | | | | | | | | | | | These changes target Find Usages feature to work with shared_ptr. Improve libs/3rdparty/cplusplus and plugins/cplusplus: parse __declspec() attribute, call to variadic function template without specified template arguments, if constexpr, c++11 attributes [[value]], function templates with default parameters, resolve order for function vs template with default parameter, template operator->() with default arguments, template specialization with numeric values, find best partial specialization, fix partial specialization for non-first specialized argument Fixes: QTCREATORBUG-7866 Fixes: QTCREATORBUG-20781 Fixes: QTCREATORBUG-22857 Fixes: QTCREATORBUG-17825 Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
* C++: Support noexcept operatorClaus Steuer2015-10-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | The code model failed to parse the noexcept operator which is often used in noexcept specifiers, e.g.: "void f() noexcept(noexcept(g()));" Consequently some c++11 headers such as unordered_map, array and unordered_set could not be parsed and no code completition was available. I have created the NoExceptOperatorExpressionAST class which is created whenever a noexcept token is found in an expression with operator precedence. The noExcept test case in the cplusplus/cxx11 test now contains a function that uses the noexcept operator. Fixed noexcept operator parsing Added the test requested by Sergey Shambir, which then revealed that i had not implemeneted the noexpect operator parsing according to the c++ specification. As stated here http://cpp0x.centaur.ath.cx/expr.unary.noexcept.html the noexcept operator is a unary-expression that contains an expression (and not a constant-expression). This should now be fixed. Change-Id: Id4a99a43b660bd83e7680274491d99a698b57094 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support ellipsis on variadic inheritance parsingJohannes Lorenz2015-06-021-0/+2
| | | | | | | Change-Id: I571aefdb1f2aba88ba0c7710f16b6d8ad2e8f5a8 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support alignas in C++11 mode.Erik Verbruggen2014-07-221-2/+23
| | | | | | Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704 Task-number: QTCREATORBUG-9279 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Split designator ASTOrgad Shaneh2014-06-241-1/+22
| | | | | | Change-Id: I9bfed2023624c818c0f35f24476693cffeaf2bbc Reviewed-by: Wang Hoi <wanghoi@126.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C: Parser: Support parsing of c99 designated initializersWang Hoi2014-06-171-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | In case: int a[6] = { [4] = 29, [2] = 15 }; struct point { int x, y; }; struct point p = { .y = 3, .x = 2 }; Grammar change when c99 language feature is enabled: old grammar: braced-init-list :: '{' initializer-list '}' new grammar: braced-init-list :: '{' designated-initializer-list '}' designated-initializer-list :: designated-initializer (',' designated-initializer )* designated-initializer :: designator* initializer-clause designator :: '.' identifier | '[' constant-expression ']' Task-number: QTCREATORBUG-1902 Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: add semantic support for C++11 alias decls.Erik Verbruggen2013-06-061-1/+4
| | | | | | | Task-number: QTCREATORBUG-9386 Change-Id: Ia68f3866c122ca5261dd73b2c740b47fb15744fc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: improve support for anonymous classesPrzemyslaw Gorszkowski2013-04-191-0/+10
| | | | | | | | | | | | | | | | | | | Fix: * highlighting * find usages * follow symbol * code completion Task-number: QTCREATORBUG-6497 Task-number: QTCREATORBUG-8963 Task-number: QTCREATORBUG-3610 Task-number: QTCREATORBUG-7579 Change-Id: I3dcaf1c515d0199c3e6bee72284fbb40064686ee Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Update frontend accordingly to AST.HNikolai Kosjar2012-12-061-1/+1
| | | | | | | $ ./cplusplus-update-frontend Change-Id: I9015abb8d3dc053c91b0107c5a0b2e8b6e2f5f30 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Store lambda captures in the code model.Nikolai Kosjar2012-11-071-0/+7
| | | | | | | | | Done-with: Erik Verbruggen Task-number: QTCREATORBUG-7968 Task-number: QTCREATORBUG-7949 Change-Id: I0cf727052d0a3536ed96ee894b18768c9538c213 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++11: More (expression-list) or brace-init-list.Christian Kamm2012-09-191-17/+0
| | | | | | | | | This time in the 'new' expression. Changed it to make new C(1, abc...) and new C{1, abc} work. Change-Id: I7232798fd083b653ee04ef9ede386d6536133e16 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow for typename Foo<T>{}, Foo{} and int{}.Christian Kamm2012-09-191-14/+6
| | | | | | | As a postfix expression. Change-Id: I65cae0571080a9fb699af61c661328ef06f97890 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Make 'enum struct', enum-base and opaque enum decls work.Christian Kamm2012-09-191-0/+9
| | | | | | | | For declarations like: enum struct Foo : long int; Change-Id: Id813efdbc31c8d70a4b40bb0101dc33a8dd2556a Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Parse alias declarations.Christian Kamm2012-09-191-0/+21
| | | | | | | | The parser no longer fails declarations like: using Foo = std::vector<int>::iterator; Change-Id: Ib3a552ebbe0147fa138db6448a52cdba8f9b9207 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow brace-init-list in range-for statement.Christian Kamm2012-09-191-5/+0
| | | | | | | | Also drop the unused 'initializer' member from RangeBasedForStatementAST. Change-Id: I078ebbc85cafa643af4bfe62d698bf7de71360e4 Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Add alignof() expression.Christian Kamm2012-09-191-0/+19
| | | | | Change-Id: Id3fb30b9a16ea724bab0d5b05e8cbddb0064e6eb Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Accept ref-qualifiers in function declarators.Christian Kamm2012-09-191-0/+4
| | | | | | | | | | Means void foo() const &; void bar() &&; and the corresponding pointer-to-member declarators now parse. Change-Id: Idbf295bd4f51cd5d9e38efcac1940b8cc2e32fce Reviewed-by: hjk <qthjk@ovi.com>
* C++11: Allow uniform initialization in ctor init lists.Christian Kamm2012-09-191-7/+3
| | | | | | | | | So class C { C() : _x{12}, _y({12}) {} }; now parses correctly. Change-Id: I4281dcb0541a86b550e74630cad6ae0a59fef1b4 Reviewed-by: hjk <qthjk@ovi.com>
* C++: Rename NewPlacementAST to ExpressionListParenAST.Christian Kamm2012-09-171-1/+1
| | | | | | | | It'll be reused as the initializer expression for declarators that are followed by "( expression-list )". Change-Id: I6c76a76641941874ef1ed21daa7b6e057c6d170f Reviewed-by: hjk <qthjk@ovi.com>
* Added support for override/final and enum classesSergey Shambir2012-07-301-0/+2
| | | | | Change-Id: I6dfe9dd606781046ff5a1ed61315741d2f332cb8 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* C++: handle destructor names with template parameters.Erik Verbruggen2012-02-231-1/+4
| | | | | | Change-Id: I74b4fd5e043db935abc18345b303d294b71e8fc2 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
* C++: Add support for C++11 range-based 'for' loopsFlex Ferrum2012-02-211-0/+41
| | | | | Change-Id: I7eef048a7952a79f031ae3d0abba68e3c5ffbfb8 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: first set of changes for decltype.Erik Verbruggen2012-02-101-0/+19
| | | | | Change-Id: I49d6ff7eb1805cd07bdfcb27bb37d4c6cadc9115 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: add support for static_assert.Erik Verbruggen2012-02-021-0/+28
| | | | | Change-Id: I82d8d60acaa9265fd25e0a3734855b19bdef9c06 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: handle noexcept specifications.Erik Verbruggen2012-02-021-1/+20
| | | | | Change-Id: I7da3affea2758b2e01124105e2521e1f2c5f6678 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++11: handle inline namespaces.Erik Verbruggen2012-02-021-0/+2
| | | | | Change-Id: Iafdcd5bc72d9724e217767ae9c216be4363cc0d3 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Recognize C++11 nullptrLeandro Melo2011-11-181-0/+10
| | | | | Change-Id: I5b7ac8f9b2137ffe9439ada4ec4aeb9cee8e249d Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix the AST code generatorRoberto Raggi2011-05-161-0/+19
|
* remove nokia copyrights from roberto's codeOswald Buddenhagen2011-05-161-31/+0
| | | | | | | | they are lying. nokia has no copyright on this code. and the double license in a single file looks weird. that's why we moved it to 3rdparty/, so it is clear it is not nokia's. Approved-by: legal
* move src/shared/cplusplus/ -> src/libs/3rdparty/cplusplus/Oswald Buddenhagen2011-05-161-0/+2850
Approved-by: legal