summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
...
* | C++: Fix handling of Objective-C/C++Francois Ferrand2016-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | - Objective C/C++ was not enabled in highlighter. - QMake project part for Objective C/C++ did not have ObjectiveC extension enabled. - As languageFeatures.objCEnabled is a bitfield, it was actually always set to 0. - Highlight ObjC class & protocol declarations. - Highlight ObjC message passing. Change-Id: I64d12c9509058d05f7adce94598cb7ce91727ac8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* | CPlusPlus: Fix isQtReservedWordTobias Hunger2016-11-301-1/+1
|/ | | | | | | checking for size >= 4 masks Q_D and Q_Q. Change-Id: If9ab7d3b2c2c571e73b98e89908e492fc6241296 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* C++: Remove concurrent access to TemplateNameIdNikolai Kosjar2016-11-041-7/+8
| | | | | | | | | | | | | | | | | | | The modification of the TemplateNameId changed "global state" because the TemplateNameId is potentially accessed by multiple threads doing lookup (access to same document and thus same symbol names). Depending on the thread scheduling and access to ClassOrNamespace::_specializations, the changed TemplateNameId "suddenly" led to inconsistent results of TemplateNameId::Compare and thus broke the std::map assertions. Get rid of the const_cast, the setter and simply construct a temporary TemplateNameId with isSpecializaton = true. Task-number: QTCREATORBUG-14911 Change-Id: Ie381d132cc0d06af351ace4257773637d1ebee4e Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CPlusPlus, Utils: Move namespace icon from CPlusPlus to UtilsAlessandro Portale2016-10-264-3/+1
| | | | | | | ...so that it can be used in the ScxmlEditor plugin Change-Id: I0e0ed050f7765bcc901db3bb2c3273456a228b5e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* C++: Enable showEnclosingTemplate also for function typeOrgad Shaneh2016-09-061-17/+21
| | | | | | | Do not require directly passing the enclosing template. Change-Id: Ie03bc58338fe003677a5f5311d86d70f499373ee Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Disable C++ keywords in C filesFrancois Ferrand2016-08-231-0/+1
| | | | | | | | | | | | In some (legacy) C files, new and delete may be used for regular identifier. There are some limitations: * Header files have no 'implicit' type, and may be parsed as C++ or ObjC depending on the other files in the project. * QMakeProject use a single ProjectPart for C and C++ files, so there will still be the issue. Change-Id: Iec11687b35f7ccf1e7c0d091b143ae90d950e440 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: Support pretty printing of template enclosing scopeOrgad Shaneh2016-08-193-2/+22
| | | | | Change-Id: Ib228184e1259585eeac61b9196195c39a9550cb9 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: Cancel parsing if editor is closedNikolai Kosjar2016-07-292-0/+14
| | | | | | | | | | | | The m_parserFuture.cancel() in ~BuiltinEditorDocumentProcessor() did not cancel anything. Thus, closing a document while the parser was running led to a blocking UI thread. Now it cancels at the next include directive it encounters. Change-Id: I092fddbbd747e0bc95265b6e9b4fcc26b3f76cb3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* C++: Add support of ref-qualifier for functions.Dmitry Ashkadov2016-06-222-0/+12
| | | | | | | | | | 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>
* Editor: Skip auto completed character only if it was recently inserted.David Schulz2016-06-212-10/+12
| | | | | | | | | | | | | | | | This means you can skip automatically inserted characters as long as you don't explicitly move the text cursor and the editor doesn't lose the focus. This will be visualized by highlighting the automatically inserted character as long as you can perform the skipping. This will reduce unexpected skipping in the case a cursor was explicitly placed before an closing brace and a closing brace is typed. Change-Id: I28e29e79ba10c9c48e8bc8817405fea630cca9bd Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* qbs build: Final steps to support building plugins "out of source".Christian Kandeler2016-06-151-124/+132
| | | | | | | | | | | | | | | | | | | | | | | - Use the entire Export block when creating a module, not just the Depends items. Adapt references to the product source directory and the "share" directory so that they point to the respective locations in the install tree. - Install dev headers for some more plugins. - Bug fixes & polishing. Create a "dev installation" like this: $ qbs qtc.make_dev_package:true qbs.installRoot:<install root> Then build your plugin against it like this: $ qbs qtc.make_dev_package:true qbs.installRoot:<install root> project.qbsSearchPaths:<install root>/qbs-resources (Using qbs from 1.5 branch; 1.5.1 requires a trivial wrapper project.) That's all. Successfully tested with all commercial plugins on Linux. Change-Id: Ie39c4717dafcd431c533421a15f2f898783d8521 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* CPP: Remove unused function.David Schulz2016-05-261-13/+0
| | | | | | Change-Id: Ib55fd0c059b2e5e117250eb4671b3352ab41b310 Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* C++: Improve automatic quoting magic.David Schulz2016-05-251-3/+16
| | | | | Change-Id: I5d3a15dc100ae9c03bbc49de99714da1c89cb0d8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Editor: Separate auto insert brace and quote magic.David Schulz2016-05-252-24/+54
| | | | | | | To allow enabling/disabling both features separately. Change-Id: Ica154e3b400823de7cf22daf006958802d751c64 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* C++: optimize paragraph insertion.David Schulz2016-05-201-12/+2
| | | | | | | | | | Do not check tokens which are returning the default return value. Do not check for tokens when a previous condition excludes the other token types. Change-Id: Id97aed9d6342c6c12e9b26acdd0a8c4b0bca0868 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Remove duplicated code from c++ and glsl completer.David Schulz2016-05-202-8/+117
| | | | | Change-Id: Ibda04771fceffef6344f6a6128d77dd8192379ca Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppEditor: Simplify insert matching characters.David Schulz2016-05-201-59/+61
| | | | | Change-Id: Ib3a94d016b615d71b1635ebe13a87575b8dc12c5 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CPlusPlus: fix gcc warningNikita Baryshnikov2016-05-131-2/+2
| | | | | | | this 'if' clause does not guard Change-Id: I004cb72dff2213738c59701d99748d7338991105 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-05-032-5/+20
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/debugger/debuggerruncontrol.cpp src/plugins/projectexplorer/projectwizardpage.cpp src/plugins/projectexplorer/xcodebuildparser.h src/plugins/qmldesigner/qmldesignerplugin.cpp src/tools/clangbackend/ipcsource/translationunits.cpp Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
| * C++: Handle invalid indices in OverviewModelNikolai Kosjar2016-04-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes the following ModelTests pass: ModelTest::nonDestructiveBasicTest() Q_ASSERT(model->data(QModelIndex()) == QVariant()); Qt::ItemFlags flags = model->flags(QModelIndex()); Q_ASSERT(flags == Qt::ItemIsDropEnabled || flags == 0); Task-number: QTCREATORBUG-13142 Change-Id: If639981079b79d8b5b3bed22fb47453650449706 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * C++: Guard against parent binding loopNikolai Kosjar2016-04-271-4/+14
| | | | | | | | | | | | Task-number: QTCREATORBUG-16146 Change-Id: Ib2a790954517859acd7ca5f16c7d889d28208fb0 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/4.0'Eike Ziller2016-04-1260-151/+218
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
| * cplusplus.qbs Remove image files entriesAlessandro Portale2016-04-111-24/+0
| | | | | | | | | | Change-Id: I2283c8f2a0da28cbaa0352e9c0142197df8615bb Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
| * CPlusPlus: New code model iconsAlessandro Portale2016-04-1156-39/+136
| | | | | | | | | | | | Change-Id: I9ad6445319d85ffb652377a00256a68d56754352 Reviewed-by: David Schulz <david.schulz@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
| * cplusplus: Make functions of Icons staticAlessandro Portale2016-04-064-111/+105
| | | | | | | | | | | | | | This avoids multiple instatiations and reloading of the same image files. Change-Id: I4d0bb955e23c1cb817671c25bff4e74fb7b3d0f4 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
* | Wholesale conversion to #pragma oncehjk2016-03-3034-137/+34
|/ | | | | | | Kudos to cgmb and https://github.com/cgmb/guardonce Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: fix trigraph parsing in macros.Francois Ferrand2016-03-081-1/+20
| | | | | | | | | | | | Trigraphs must only be parsed before/during preprocessing. The preprocessor will now replace trigraphs with their standard form, and re-lexing in TranslationUnit will not try to parse any trigraph. Also added a few missing trigraphs: ??=, ??', ??! and ??-. Task-number: QTCREATORBUG-13253 Change-Id: I1723ed53b00090b878c22b83b7e963b647b65f72 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppEditor: Generate doxygen comments for functions with macrosNikolai Kosjar2016-03-044-7/+40
| | | | | | | | | ...at least for object-like macros. This handles the common case where a macro before the function signature annotates the DLL import/export. Task-number: QTCREATORBUG-15819 Change-Id: I79f22508188019402fb7345222408aaf90106f20 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-1965-1088/+807
| | | | | | | * Update remaining files in src Change-Id: I1896f17fcf34f71c3310c87899fb5171b8e4afb1 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: Add missing includesNikolai Kosjar2015-11-261-0/+1
| | | | | | | ...that are needed for building unittest.pro. Change-Id: I05a87febbb4a17752c4321b868f71cabf258e1dd Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-1916-1173/+1614
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...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++: Limit template instantiation depthOrgad Shaneh2015-11-122-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A recursive template generates infinite expansions. Consider the following example: template <class R1> struct Base { }; template<typename R> struct Derived : Base< typename Derived<typename Base<R>::type>::type, typename Derived<typename Base<R>::type>::type >::type {}; R is instantiated as Base<R>::type, which causes another instantiation of R into Base<Base<R>> etc... This is not a solution, but a workaround. Task-number: QTCREATORBUG-15141 Change-Id: Ib04f70275e07919e2cb6c7fb61a2045bd52f4a7d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Don't put QString in static attributesAleix Pol2015-10-092-3/+3
| | | | | | | | | | It crashed in some places on our code-base due to the so-called "static initialization order fiasco". As a solution, it turns the variable into a function. This shouldn't have a penalty due to QStringLiteral. Change-Id: I9f8a955afdff878dc2f0db16fec861d81250c243 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: Support noexcept operatorClaus Steuer2015-10-032-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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++: Revert problematic template specialization changesNikolai Kosjar2015-09-101-80/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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++: Fix MSVC assert in std::isspace()Nikolai Kosjar2015-09-021-1/+1
| | | | | | | | | | ...when dealing with UTF8 bytes. std::isspace() expects unsigned char, not char. Change-Id: I3f9b5e347d79cf94015cc99f8797d5feab406151 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* C++: Fix expensive lookup for boostNikolai Kosjar2015-08-211-4/+2
| | | | | | | | | | | | | | | | | 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++: Fix potential crashOrgad Shaneh2015-08-031-6/+10
| | | | | | | | If no template is found, findSpecialization will crash Task-number: QTCREATORBUG-14748 Change-Id: I94b970e6eb994f0a8d85a4b996e52fcff0affef3 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix crash in template argument resolvingOrgad Shaneh2015-08-031-2/+3
| | | | | | | | Occurs in boost/phoenix.hpp Task-number: QTCREATORBUG-14748 Change-Id: If89b0db48346aac72e0d8aaa8d165b2bf43bd784 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Do not let ASTPath calculate line/column for generated tokensNikolai Kosjar2015-07-312-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | ASTPath uses TranslationUnit::getPosition(), which returns reasonable results for: 1. non-expanded tokens 2. expanded but not generated tokens The expanded *and* generated tokens case is not handled since there is no reasonable mapping from generated tokens to a continuous line/column information. Consider: #define DECLARE_FOO int foo; // Multiple generated tokens DECLARE_FOO // ...can be mapped to this line, but to which columns? Since the result where not valid for the expanded and generated case, ASTPath took the wrong branches. Avoid this by skipping generated tokens. Change-Id: I33a2e0f62917f87d691b19feaeef67b09ea8d563 Task-number: QTCREATORBUG-13386 Task-number: QTCREATORBUG-13390 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* PNG: Run pngcrush on images with iCCP or sRGB profilesTobias Hunger2015-07-035-0/+0
| | | | | | | | This quietens warnings from libPNG during startup and shrinks the image sizes. Change-Id: Ieb4cb5e8ba30b99653896e283c2fb2cc267257f2 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* C++: Cleanup LookupContextOrgad Shaneh2015-07-011-252/+114
| | | | | | | | | | | | | | 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-292-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+7
| | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add icons for static fields and functions.Alexander Izmailov2015-06-2210-10/+47
| | | | | | | Icons for static members in completion list now with S letter. Task-number: QTCREATORBUG-203 Change-Id: I6c997ad14eeb500936ffe73e2fc0ad8e552a46c9 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
* Introduce dragging for all explorer nodes.Jochen Becher2015-06-151-3/+3
| | | | | | | | | | | | | Extend drop support with variant values. A drop may be a file drop or a value drop or both. Rename Utils::FileDropSupport to Utils::DropSupport and add methods to add not only files but any QVariant value to the mime data. Project explorer adds dragged nodes (which will be needed for future ModelEditor plugin). Change-Id: I799542c60fdecb3e64af0d3ba47b6caa9adbcfd7 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
* C++: Support default template argument lookup for specializationOrgad Shaneh2015-06-092-40/+61
| | | | | | | | | | | | | | | | | | | 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++: Remove scope argument from initializeSubstOrgad Shaneh2015-06-092-6/+4
| | | | | | | Use the template scope instead. Change-Id: I8144427e14644697c709643da7c0ae0b0841e34d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Improve accuracy in findSpecializationOrgad Shaneh2015-06-091-34/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>