aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Symbols.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CppEditor: Remove extra CPlusPlus::Class memberChristian Kandeler2022-09-161-5/+0
| | | | | | | | | | | | | | | | | | | Amends 0fab5956ea91dc0ee40b4d99605ec26a3720c5c8. We want to avoid carrying these eight bytes ber Class instance around. Instead, we now just replace the (anonymous) struct name with the typedef'ed one. Note that in C (but not C++), this is possible: struct S {}; typedef struct {} S; struct S s1; S s2; However, our code model has never respected the extra struct namespace, so it can already not distinguish between occurrences of "S" and "struct S". Change-Id: I55feafea7d3a4a5848e10f7011f633a2ce0f626e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppEditor: Store typedefed name for anonymous structsChristian Kandeler2022-09-151-0/+5
| | | | | | | | | ... and use it as the struct display name in some places. Fixes: QTCREATORBUG-26611 Change-Id: I1b127f5705307a0fabd2441ff871162c882927a5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CPlusPlus: Inline more simple Type related functionshjk2022-06-281-7/+7
| | | | | Change-Id: I2103e8047b385b438e58072e8a2689f1889d2724 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some Scope related simple functionshjk2022-06-281-1/+0
| | | | | Change-Id: I23486fdfa749fe864c04d5c1a7cede21fb16005b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CPlusPlus: Inline some simple central functionshjk2022-06-241-338/+11
| | | | | | | | | | | | | 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>
* CPlusPlus: Provide information about the "static" specifierChristian Kandeler2020-11-091-0/+1
| | | | | | | | | | ... 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: Do not ignore namespacesChristian Kandeler2020-07-201-0/+24
| | | | | | | | | | | | ... when comparing type names. For instance, this is relevant when deciding whether to offer the "Apply signature changes" refactoring action. Add fallback code for function lookups, which was relying on the relaxed semantics for parameter types. Fixes: QTCREATORBUG-9856 Change-Id: I2001b77034ff15e96a23e3359d19654d0f43f60b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* C++: fix built-in code model to work with shared_ptr on MSVC 2017Volodymyr Zibarov2020-05-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | 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++: Transfer noexcept specifier for refactoring actionsNikolai Kosjar2019-10-081-0/+6
| | | | | | | | | | | | | | This applies for e.g. * "Add Definition..." (on function decl) * "Move Definition..." (on function decl) * "Insert Virtual Functions of Base Class" (on class specifier) Fixes: QTCREATORBUG-11849 Fixes: QTCREATORBUG-19699 Change-Id: I0d259bc1782470f3b3f19617230005a5594a5cca Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Some clang-tidy -use-modernize-nullptrhjk2019-08-011-21/+21
| | | | | Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-65/+65
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CPlusPlus: Fix some crashhjk2018-05-161-0/+3
| | | | | Change-Id: I8b98d86e7d5321e2420d388abba159474d7ad799 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Merge remote-tracking branch 'origin/4.4'Eike Ziller2017-09-191-1/+5
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/debuggerdialogs.cpp src/plugins/debugger/gdb/remotegdbserveradapter.cpp Change-Id: I1ae77869887a8d9ef2a33439f2733315db9e0cf0
| * CPlusPlus: Avoid nullptr accessNikolai Kosjar2017-09-131-1/+5
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-18903 Change-Id: I852b5de453d44c16adffd44c89900cfb8c3cc522 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | C++: fix lookups for functions with const argsIvan Donchevskii2017-07-111-1/+15
|/ | | | | | | | | Make declarations equal in case they differ only by argument const and/or volatile (13.1.3.4). Task-number: QTCREATORBUG-18475 Change-Id: Id0561fda3b9081b92716a8739ba9963e90b5d709 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: fix code completion of stl containers in internal code modelPrzemyslaw Gorszkowski2017-06-151-5/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix makes some trick and replaces existing typedef of 'pointer' to the simplest one(only in class unique_ptr), e.g.: template <class _Tp> class unique_ptr { typedef some_strange_things pointer; pointer operator->(); } is replace with template <class _Tp> class unique_ptr { typedef _Tp* pointer; pointer operator->(); } In most of the implementation of unique_ptr it should work. Similar approach is done for std::list, std::vector, std::queue, std::set, std::multiset, std::unordered_set. It is done in this hacky way to omit problems with cyclic and complex resolving of typedefs. Change-Id: I1363dfc5e23d3cd2fa7af7fc27423bfbac2d894d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Store template typename argument declarator typeOrgad Shaneh2016-08-191-0/+2
| | | | | | | | Differentiate class from typename. Used by a follow-up commit for pretty printing, preserving the original declarator. Change-Id: I496505f5062abb69d5552e5422db256d49d164c4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Add support of ref-qualifier for functions.Dmitry Ashkadov2016-06-221-0/+6
| | | | | | | | | | Now the ref-qualifier (& or &&) of the function declaration is propagated to GUI. For example, 'Refactor' -> 'Add Definition' preserves the ref-qualifier. Change-Id: I8ac4e1cad4e44985e94230aabbd9858a7e929fee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-191-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...which was least buggy. The bugs fixed by the changes we revert here (highlighting/completion for code involving templates) were minor compared to ones we currently have. Those bugs will be addressed by the clang code model anyway. Relevant commits were collected via: $ cd ${QTC}/src/libs/cplusplus $ git log \ --no-merges \ --format=oneline \ v3.4.2..HEAD \ -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \ ../../plugins/cpptools/cppcompletion_test.cpp From this list the following were skipped due to irrelevance: 88c5b47e535d91f3db99882d5b50b263b46f223c # CppTools: Minor cleanup in completion tests e5255a1f5cac284c4f0d4a85203878c84da86e85 # CppTools: Add a test for ObjC not replacing dot with arrow 5b12c8d63a30e281274cdc267efabead2c736bd8 # CppTools: Support ObjC in member access operator tests 9fef4fb9ca4e65e20ff13b98bcf15e3c6232fdfb # CPlusPlus: Fix warnings about overriding visit(...) methods There were only minor conflicts while reverting those. This changes touches so many files because there were quite some cleanups and renames after the 3.4.2 release. Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-15211 Task-number: QTCREATORBUG-15213 Task-number: QTCREATORBUG-15257 Task-number: QTCREATORBUG-15264 Task-number: QTCREATORBUG-15291 Task-number: QTCREATORBUG-15329 Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* C++: Ignore explicit template instantiationsOrgad Shaneh2015-06-291-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Defined in section 14.7.2 of the standard. Fixes completion for std::string. The following explicit instantiation appears in bits/basic_string.tcc: extern template class basic_string<char>; This is wrongfully considered a specialization for a forward declaration (like `template<> class basic_string<char>` is). Introduce a new Symbol type for explicit instantiations. Use-case: template<class T> struct Foo { T bar; }; template class Foo<int>; void func() { Foo<int> foo; foo.bar; // bar not highlighted } Change-Id: I9e35c8c32f6b78fc87b4f4f1fc903b42cfbd2c2b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support ellipsis on variadic inheritance parsingJohannes Lorenz2015-06-021-0/+6
| | | | | | | 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++: Get rid of {Name,Type}::isEqualTo()Nikolai Kosjar2014-05-231-143/+0
| | | | | | | | | ...since it's superseded by the class Matcher. For consistency, rename FullySpecifiedType::isEqualTo() to match(). Change-Id: I07640f9218d814e0350265de45f05929e5d595a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix some Matcher::match() functionsNikolai Kosjar2014-05-231-14/+11
| | | | | | | ...before using Matcher instead of {Type,Name}::isEqualTo(). Change-Id: Iba1c04064799fe9c81fe997dbd54fc02b15cdec7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Do type and name equality checking in a safe manner.Erik Verbruggen2014-03-271-12/+12
| | | | | | | | | Change the TypeMatcher to also match names, and use two "block" lists in SafeMatcher to prevent infinite recursion. Task-number: QTCREATORBUG-11240 Change-Id: I0367ae795ee6be579b83aeb8d46723c877e4aa75 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Ignore return type on function overrides comparisonOrgad Shaneh2013-12-281-10/+15
| | | | | Change-Id: I9933e1cc1fb996181e818e2ea0aff76f9255f849 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Fix MSVC-64 warnings about size_t -> int truncations in C++-lib.Friedemann Kleint2013-09-121-3/+3
| | | | | Change-Id: Ibe6f41ac15df1ec685b0d0766ff568abf6f3ae7e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: handle non-arguments in function parameter scope gracefulyErik Verbruggen2013-04-091-8/+23
| | | | | | Task-number: QTCREATORBUG-8316 Change-Id: I8897f75f30d3aeaf049cc792060c582ab1e3343d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: use argumentCount in loops in initializer.Erik Verbruggen2013-03-151-8/+10
| | | | | | | | argumentCount is a more expensive function, so try to call it only once, esp. in loops. Change-Id: I6f0d420352743ec444487ce3f506ef28e5282d1e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix crash when handling lambdas as argumentsNikolai Kosjar2013-03-061-0/+3
| | | | | | | | Proper fix will follow. Task-number: QTCREATORBUG-8316 Change-Id: I7c86f0b0b0802c310bcce619b5c69ad33ffa0d52 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++11: Correct scoping for scoped enums.Christian Kamm2012-10-311-0/+12
| | | | | | | Fixes completion, highlighting and find usages. Change-Id: I1ea12c6a9c7a4f8ba0f9d55e31d6b7986233e7d8 Reviewed-by: hjk <qthjk@ovi.com>
* Remove "icheck build" test.Christian Kandeler2012-09-071-37/+0
| | | | | | | Does not build, is not being maintained, purpose is unclear. Change-Id: I00f3bbc9580b57e3945882a411af502a78f4864f Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
* Added support for override/final and enum classesSergey Shambir2012-07-301-0/+12
| | | | | Change-Id: I6dfe9dd606781046ff5a1ed61315741d2f332cb8 Reviewed-by: Christian Kamm <christian.d.kamm@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++: Type deduction for auto-declared variables implementedFlex Ferrum2012-01-311-0/+12
| | | | | | | | | | | Handled to major cases of 'auto' variable declaration: 1. auto var = someInitializer; 2. Q_FOREACH(auto item, collection) or foreach(auto item, collection) In first case type deducted directly from initializer. If variable has no initializer then corresponded error reported. In second case type deducted from '*collection.begin()' expression. Change-Id: Ie930add1648b99440281ae04d973fd6904bc9e46 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* C++: Fix arg. count for functions with function-try-blocksLeandro Melo2011-10-211-3/+4
| | | | | | Task-number: QTCREATORBUG-6343 Change-Id: I71575098c71611dc8514288f7938af4c409ebaa3 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* minor stylehjk2011-09-191-1/+1
| | | | | | Change-Id: Id21e8a3962550a1c66d761e718b48a8fcf4053e7 Reviewed-on: http://codereview.qt-project.org/5122 Reviewed-by: hjk <qthjk@ovi.com>
* Added support to C++ symbols rewriting.Roberto Raggi2011-05-171-0/+128
| | | | | | This should simplify full C++ template instantiations. Reviewed-by: Christian Kamm
* 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/+1119
Approved-by: legal