summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcompletion_test.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-2891/+0
| | | | | | | | | | | | | | | | 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>
* CppTools: Use test objects to group related test functionsChristian Kandeler2021-08-261-14/+16
| | | | | Change-Id: I9ed2ad222579f49c20c75a53c862bb7251cff28d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* TextEditor: use Utils::FilePath as file member in AssistInterfaceDavid Schulz2020-09-041-1/+1
| | | | | Change-Id: I3bf9b013b9350411f918efdb9d1a36a2c22bf972 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Replace QT_USE_FAST_{OPERATOR_PLUS,CONCATENTION} by QT_USE_QSTRINGBUILDERhjk2020-08-071-2/+2
| | | | | | | | | | QT_USE_FAST_CONCATENATION doesn't do anything nowadays. Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS for QStrings and enables more QStringBuilder use for QByteArrays. Change-Id: Ibd297817c50d86661d47822799f989447249af1b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Make TextEditor setup more flexibleEike Ziller2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | So far it was only possible to combine TextEditorFactory, BaseTextEditor and TextEditorWidget directly. That TextEditorWidget is also directly a QPlainTextEdit made it impossible to "decorate" the text editor widget with something else without a lot of effort. Make it possible to create a text editor factory that returns an arbitrary widget, as long as it can be "cast" to a TextEditorWidget with either qobject_cast or Aggregation::query. That way the TextEditorWidget instance can be attached to the editor widget via Aggregation. Adapt other code that accesses TextEditorWidget from editors accordingly. Introduce a common method how to do that. Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: David Schulz <david.schulz@qt.io>
* More Utils::toSet/toListhjk2019-07-041-1/+1
| | | | | | | ... and unrelated cosmetic changes. Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* CppTools: modernizeAlessandro Portale2019-01-211-7/+6
| | | | | | Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Add system include path to HeaderPath and merge ProjectPartHeaderPathMarco Bubke2018-09-101-1/+1
| | | | | | | | | | | | | System include paths are appended after other includes by the compiler. So we should set them as system includes and not as normal includes. Otherwise we change the include order. Headers in system include paths are not cluttering the screen with unwanted warning and by the way improve performance too. ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them. Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CodeAssist: use shared pointer to pass around proposal modelsDavid Schulz2018-02-271-5/+5
| | | | | | Task-number: QTCREATORBUG-17752 Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67 Reviewed-by: hjk <hjk@qt.io>
* TextEditor: move convenience from texteditor to utilsIvan Donchevskii2017-09-221-3/+2
| | | | | | | Allows to use this header without texteditor dependency. Change-Id: I706f42799c3ea42473a716fa9ef9f3cfbef6fdd4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: fix code completion of stl containers in internal code modelPrzemyslaw Gorszkowski2017-06-151-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove spaces in initializer listsTim Jenssen2017-02-221-138/+138
| | | | | | | Format initializer lists code style like. Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013 Reviewed-by: hjk <hjk@qt.io>
* Replace some more occurrences of QStringList() << patternChristian Stenger2017-02-081-506/+166
| | | | | Change-Id: Ic7193ac3a741763479a9ef129ed05cb7ca64f1e9 Reviewed-by: hjk <hjk@qt.io>
* C++: Fix completion for doxygen tags IINikolai Kosjar2016-03-311-0/+7
| | | | | | | | | | | | | | | | | For assist processors that run in a worker thread, the QTextDocument is recreated with AssistInterface::prepareForAsyncUse and AssistInterface::recreateTextDocument. Since some assist processors (C++, QmlJS) rely on the user states of the QTextBlocks, these must be recreated, too. In the referenced bug report the lexer state (user state) of the previous QTextBlock was invalid and thus the "Doxygen tag completion" failed. Task-number: QTCREATORBUG-9373 Change-Id: If668e98aa6f9fe9fc107c7476fc831e92a0d7572 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* C++: Fix completion for doxygen tags INikolai Kosjar2016-03-311-0/+35
| | | | | | | | | | | | | | | There are three cases that must be handled: 1. Completion in C++ style comment 2. Completion in first line of a C style comment 3. Completion in non-first line of a C style comment This change fixes case 1 + 2. Case 3 will be addressed in a follow-up change, same goes for the duplication. Task-number: QTCREATORBUG-15143 Change-Id: I449711f965ddcbbe6158870a8a5ae33218e0d238 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* CppTools: Move ProjectPart in its own header fileMarco Bubke2016-01-131-1/+1
| | | | | | | | Also extracting inline HeaderPath class and change projects list in vector because the size is larger than a pointer. Change-Id: I885fdff3fe9bccc877634d1615249755f5b674fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-191-503/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...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>
* CppTools: Minor cleanup in completion testsOrgad Shaneh2015-10-201-3/+3
| | | | | | | | * Remove superfluous dot from test file name * Reuse an existing member Change-Id: I735dee09ae7ceef4509a4bda87118baaf4d11b01 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Comment out a flaky testNikolai Kosjar2015-09-281-16/+15
| | | | | | | | | | | | | | | | | The test relied on logic that was reverted with change 915f68deac95bf17bd97d1a2644264afb0b86f0b. LookupScopePrivate::findSpecialization() gets a "TemplateNameIdTable &specializations" with a non-deterministic order. Without the extra logic, the very first entry will be chosen as the found specialization. The non-deterministic order comes from the TemplateNameId::Compare, which calls std::lexicographical_compare() with the template arguments, which are FullySpecifiedTypes. The result of FullySpecifiedType::operator<() might depend on a pointer comparison. Change-Id: I8d69d1bb5831145b1c21a5ea848c0043f17ec415 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* CppTools: Add a test for ObjC not replacing dot with arrowOrgad Shaneh2015-09-231-0/+10
| | | | | | Task-number: QTCREATORBUG-14583 Change-Id: Icffa9039215a841e200f20b83cda37d782b94e9a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Support ObjC in member access operator testsOrgad Shaneh2015-09-231-3/+18
| | | | | | | Actual test is added in a follow-up commit. Change-Id: I645d1e50d4ac9d281e31a0375f64fea849bf5e25 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Revert problematic template specialization changesNikolai Kosjar2015-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | This mainly reverts commit 81721f678122bc66213b5f2a5fbf36c43e5e1a35 C++: Fix resolving of recursive typedef commit 2070431d8ca867acfb4391c275cd82caff4d711a C++: Fix resolving of partial specialization and some bits of other changes due to dependencies. It also reverts commit e0594fc9b906a32f5c8ac70265490cf86044676f C++: Fix expensive lookup for boost which attempted to solve the upcoming problems. Task-number: QTCREATORBUG-14741 Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-14962 Change-Id: I3f9e1f97199e5199b71da394fc27051c7709bd1f Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* C++: Add testsNikolai Kosjar2015-08-311-0/+96
| | | | | | | | | | ...for two regressions that were introduced by commit e0594fc9b906a32f5c8ac70265490cf86044676f C++: Fix expensive lookup for boost Change-Id: I1fa01e626da480ca53e04b4709fec458378e7aef Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Fix expensive lookup for boostNikolai Kosjar2015-08-211-0/+18
| | | | | | | | | | | | | | | | | With this patch, CheckSymbols takes about 200ms for processing the boost/proto hello world example [1]. Before, it needed about 11 seconds (timer in CheckSymbols::run). Same goes for including <boost/fusion/include/zip.hpp>. The custom ProcessedSet object was added to support "completion for typedefs for templates in namespaces", but apparently that's not needed anymore, as the added test proves. [1] http://www.boost.org/doc/libs/1_58_0/doc/html/proto/users_guide.html#boost_proto.users_guide.getting_started.hello_world Task-numer: QTCREATORBUG-14889 Task-numer: QTCREATORBUG-14741 Change-Id: I90454e8970a9d04033d56beeb0c6d7a0d4e6cc62 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* C++: Cleanup LookupContextOrgad Shaneh2015-07-011-0/+23
| | | | | | | | | | | | | | Since the cache is now more reliable, some workarounds and optimizations in the instantiation process are not needed anymore. Also avoid instantiation of base classes when expandTemplates is disabled. As a bonus, we now resolve decltype of template function for a type that is not referenced anywhere but in the decltype. Change-Id: Idf42ba7280992db477c9aa62bb1815b27174594d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Ignore explicit template instantiationsOrgad Shaneh2015-06-291-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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++: Resolve function-scope typedef inside lambdaOrgad Shaneh2015-06-291-0/+15
| | | | | | | | | | | | | | | | | Use-case: struct Foo { int bar; }; void func() { typedef Foo F; []() { F f; f.bar; // bar not highlighted }; } Change-Id: Ifaee2d125931d993acad69f03031a675c6180858 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of using in enclosing scopeOrgad Shaneh2015-06-291-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Use-case: namespace Ns { namespace Nested { struct Foo { void func(); int bar; }; } } using namespace Ns::Nested; namespace Ns { void Foo::func() { bar; // bar not highlighted } } Change-Id: I6e667d63eb40511d65532c4d6d317aa4028a87a4 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Support default template argument lookup for specializationOrgad Shaneh2015-06-091-0/+13
| | | | | | | | | | | | | | | | | | | This fixes std::vector, although it doesn't really resolve numeric template arguments. It just picks the first specialization. Use-case: class Foo {}; template<class T1 = Foo> class Temp; template<> class Temp<Foo> { int var; }; void func() { Temp<> t; t.var; // var not highlighted } Task-number: QTCREATORBUG-8922 Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Improve accuracy in findSpecializationOrgad Shaneh2015-06-091-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * If a template type is specialized as a pointer, accept only pointers (of any type) * Same for references and arrays * Only if the specialized type is not part of the template, match it against the input. Fixes resolving of partial specialization with pointers. Use-cases: // 1 struct b {}; struct a : b {}; template<class X, class Y> struct s { float f; }; template<class X> struct s<X, b*> { int i; }; template<class X> struct s<X, a*> { char j; }; void f() { s<int, a*> var; var.j; // j not highlighted } // 2 template <typename T> struct Temp { T variable; }; template <typename T> struct Temp<T &> { T reference; }; void func() { Temp<int&> templ; templ.reference; // reference not highlighted } // 3 class false_type {}; class true_type {}; template<class T1, class T2> class and_type { false_type f; }; template<> class and_type<true_type, true_type> { true_type t; }; void func2() { and_type<true_type, false_type> a; a.f; // f not highlighted } Task-number: QTCREATORBUG-14036 Change-Id: Idee5e3f41d15c0772318d3837cbcd442cb80293a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of templated partial specializationOrgad Shaneh2015-06-041-0/+15
| | | | | | | | | | | | | | | | | | Use-case: template<class T> struct t {}; template<class> struct s { float f; }; template<class X> struct s<t<X>> { int i; }; void f() { s<t<char>> var; var.i; // i not highlighted } Task-number: QTCREATORBUG-14034 Change-Id: I5d00bc3247352fca4af4c41a47c208ec3e193c8e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of partial specializationOrgad Shaneh2015-06-041-0/+14
| | | | | | | | | | | | | | | | | Use-case: struct b {}; template<class X, class Y> struct s { float f; }; template<class X> struct s<X, b> { int i; }; void f() { s<int, b> var; var.i; // i not highlighted } Task-number: QTCREATORBUG-14036 Change-Id: I70a87499e0a375e84d992ca0a79d77270a3419e8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix lookup for instantiation of usingOrgad Shaneh2015-06-021-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yet another std::vector issue... Use-cases: // Case 1 template<typename T> using type = T; // Case 2 struct Parent { template<typename T> using type = T; }; // Case 3 template<typename T> struct ParentT { template<typename DT> using type = DT; }; struct Foo { int bar; }; void func() { type<Foo> p1; Parent::type<Foo> p2; ParentT<Foo>::type<Foo> p3; // bar not highlighted p1.bar; p2.bar; p3.bar; } Task-number: QTCREATORBUG-14480 Change-Id: I9ab08ea7360a432c48eb4b85aa0d63e08d2464c1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix decltype resolving for template functionOrgad Shaneh2015-06-011-0/+15
| | | | | | | | | | | | | | | | | | | | | The last nail for std::unique_ptr (GCC variant, MSVC still doesn't work). Use-case: template<typename T> static T f(); struct Foo { int bar; }; void fun() { decltype(f<Foo>()) s; s.bar; // bar not highlighted } Task-number: QTCREATORBUG-14483 Task-number: QTCREATORBUG-8937 Change-Id: I5bab757400b070cf9dbb688a44fd8eafe95ddc61 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix decltype resolving for nested instantiated classOrgad Shaneh2015-05-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The enclosingScope of a cloned nested class is not the original class but the cloned parent. Use-case: template <typename T> struct Temp { struct Nested { static T f(); typedef decltype(f()) type; }; }; struct Foo { int bar; }; void fun() { Temp<Foo>::Nested::type s; s.bar; // bar not highlighted } Task-number: QTCREATORBUG-14483 Change-Id: I3e15399a78a7492f740db8d0c7d5c84adf77d1d0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix resolving of recursive typedefOrgad Shaneh2015-05-201-1/+0
| | | | | | | | | | | | | | | | | | Use-case: template<typename _Tp> struct Temp { typedef _Tp value_type; }; struct Foo { int bar; }; void func() { Temp<Temp<Foo> >::value_type::value_type *p; p->bar; // bar not highlighted } Task-number: QTCREATORBUG-14237 Change-Id: Ie0b21b81526d610437ed2d2877083bb929c25047 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: fix code completion for decltyped typeOrgad Shaneh2015-05-201-0/+23
| | | | | | | | | | | | | | | | | | | | example: struct Foo { int bar; }; Foo foo() { return Foo; } typedef decltype(foo()) TypedefedFooWithDecltype; void fun() { decltype(foo()) decltypeFoo; decltypeFoo.;// code completion should work here TypedefedFooWithDecltype typedefedFooWithDecltype; typedefedFooWithDecltype.;// code completion should work here } Started-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Task-number: QTCREATORBUG-14483 Change-Id: I296ceed9d896c68cf0651265afb08a1fc42f9a68 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix explicit typedef from base type in templated classOrgad Shaneh2015-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use-case: struct Foo { int bar; }; template<typename T> struct Base { typedef T F; }; template<typename T> struct Derived : Base<T> { typedef typename Base<T>::F F; F f; }; void func() { Derived<Foo> d; d.f.bar; // bar not highlighted } Task-number: QTCREATORBUG-14218 Change-Id: Ic0b22b2f8adf80ff88a2f8b7359c276a744f89e8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix lookup for instantiation by class objectOrgad Shaneh2015-05-151-1/+22
| | | | | | Task-number: QTCREATORBUG-14352 Change-Id: I2ce4bc1d0dba2414afe050e80607b581686081a9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.4'Eike Ziller2015-05-071-3/+28
|\ | | | | | | | | | | | | Conflicts: src/libs/extensionsystem/pluginview.cpp Change-Id: I410156c1003d5dc81e915110c6d432bcd71da010
| * CppTools: Offer "override" and "final" as completion itemsNikolai Kosjar2015-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | These are special identifiers and were thus not included in the 'add all keywords' handling. Change-Id: I7f65df5711193e945bfa955dcb70a6ab454606b5 Task-number: QTCREATORBUG-11341 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
| * CppTools: Fix global completion after "/// text."Nikolai Kosjar2015-04-241-3/+26
| | | | | | | | | | | | | | | | | | | | | | Like for other comments, don't try member completion if the doxygen comment ends with a dot. Task-number: QTCREATORBUG-8597 Change-Id: I2d5204ba8f45fc9ee94e285a907364cc722e62c7 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | C++: Fix specialization resolution for nested typesOrgad Shaneh2015-04-281-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use-cases: template<typename T> struct Traits { typedef typename T::pointer pointer; }; template<typename _Tp> struct Traits<_Tp*> { typedef _Tp *pointer; }; struct Foo { int bar; }; // 1 template<typename T> class Temp { protected: typedef Traits<T> TraitsT; public: typedef typename TraitsT::pointer pointer; pointer p; }; void func() { Temp<Foo *> t; t.p-> // complete } // 2 class Temp2 { protected: typedef Foo *FooPtr; typedef Traits<FooPtr> TraitsT; public: typedef typename TraitsT::pointer pointer; pointer p; }; void func2() { Temp2 t; t.p-> // complete } Task-number: QTCREATORBUG-14141 Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: Improve template argument detection for nested typesOrgad Shaneh2015-04-231-0/+23
| | | | | | | | | | Change-Id: I7dd3f552f0e85413de8e58047d1fba39c7237182 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | Merge remote-tracking branch 'origin/3.4'Eike Ziller2015-04-151-8/+35
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/libs/timeline/qml/MainView.qml src/plugins/git/gitclient.cpp Change-Id: I0b6ec7b9a592014deb0dd2e1145b19dd6753b1c3
| * CppTools: Fix global completion after '&'Nikolai Kosjar2015-04-131-8/+35
| | | | | | | | | | | | | | | | | | | | | | Regression introduced by commit 9fb5b0be15a1d877132942ca5da1829510f23361 CppTools: Add basic completion support for qt5 style signals/slots Change-Id: I0a8e5ef31c1394512a51a26ed08b0f445add5acd Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* | CppTools: Add failing tests for recursive instantiationOrgad Shaneh2015-04-111-0/+32
|/ | | | | | Task-number: QTCREATORBUG-14237 Change-Id: I59ae931994ef6577010a4544219ba3b0cd85c677 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
* CppTools: Add a failing test for explicit template base typedefOrgad Shaneh2015-04-011-0/+29
| | | | | | Task-number: QTCREATORBUG-14218 Change-Id: I1cccc522f0d484e966f97bea86236e83caec754a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Add 2 failing tests for double pointer indirectionOrgad Shaneh2015-04-011-0/+72
| | | | | | | ... when resolving specialization Change-Id: Id3b673fa0c85b13f9a3b4bda022ef2ff18d4c2ac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>