summaryrefslogtreecommitdiff
path: root/src/libs/cplusplus/LookupContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Braces cleanupOrgad Shaneh2013-11-141-6/+3
| | | | | Change-Id: I8413252c90a1487d291f15d92837c30ab697b245 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: Remember the class a ClassOrNamespace is based onNikolai Kosjar2013-11-121-7/+15
| | | | | Change-Id: I0d333ff9489e46c4fa1923d70ca950f67ffa3f44 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppEditor: Fix crash in CompleteSwitchCaseStatementNikolai Kosjar2013-10-171-0/+4
| | | | | | | Task-number: QTCREATORBUG-10366 Change-Id: I6d5af5e7a59f3867141c8d7f098128d3db532ee5 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-08-271-1/+1
|\
| * C++: Fix crash in LookupContext::lookupType()Nikolai Kosjar2013-08-231-1/+1
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-10019 Change-Id: I7970c2f1ea3044e11250b8dbaf9b29ba3e7f34ef Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | CppTools: CppPreprocessor: Track also unresolved includesNikolai Kosjar2013-08-221-1/+1
| | | | | | | | | | Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix matching type with using from other namespacePrzemyslaw Gorszkowski2013-08-201-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | example code: struct S { int s; }; namespace std { template <typename T> struct shared_ptr { T* operator->(); }; } namespace NS { using std::shared_ptr; } int main() { NS::shared_ptr<S> p;// for this shared_ptr return 0; } Fixes: * find usages * follow symbol * highlighting * marking Task-number: QTCREATORBUG-7978 Change-Id: I28994c960b87ddd400e1d7b860fca6c6683bbb5a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Fix coding style for else statementsOrgad Shaneh2013-07-171-9/+7
| | | | | | | | | | Change-Id: I1309db70e98d678e150388c76ce665e988fdf081 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | C++: Fix names of functions dealing with enclosing scopesNikolai Kosjar2013-07-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | ...in order to better tell apart the type related functions isScope()/asScope() and the functions dealing with enclosing scopes: * scope() --> enclosingScope() * setScope() --> setEnclosingScope() * resetScope() --> resetEnclosingScope() Change-Id: Id743a7d1b6a1a1a0ffcd8568cbd8ebbdfc16eaa1 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* | C++: fix local types and membersPrzemyslaw Gorszkowski2013-07-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes code model when we have local type which contains a member of other type, e.g.: struct OtherType { int otherTypeMember; }; void foo() { struct LocalType { int localTypeMember; OtherType ot; }; LocalType lt; lt.ot.//no code completion } Change-Id: I018f492a6c48bfcbba0ef376ef005825e2b13f35 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-07-111-1/+2
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/plugins/projectexplorer/projectexplorer.cpp Change-Id: I37e550646f877b50693043894976a693ac22ad5e
| * C++: Introduce caches to Clone* classesNikolai Kosjar2013-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | Done-with: Erik Verbruggen <erik.verbruggen@digia.com> Task-number: QTCREATORBUG-8747 Change-Id: I7cb694f8180c6aa932b07066d98d095340111324 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: xSacha Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-06-271-1/+0
|\ \ | |/ | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs Change-Id: I1aa7506519e0f461f33921ca20ce1b51adb5783f
| * Merge remote-tracking branch 'origin/2.7' into 2.8Eike Ziller2013-06-261-1/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/cplusplus/LookupContext.cpp src/plugins/plugins.pro src/plugins/qnx/Qnx.pluginspec.in src/plugins/qnx/qnx_dependencies.pri Change-Id: I6c406c2503845b08c4852db99c64491a325629c7
| | * C++: Handle recursive using/typedef declarationsNikolai Kosjar2013-06-251-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remember using/typedef declarations we have already looked up and stop if we try it again. Change-Id: I91bf0aef4df18539a47d015f0113543aef1f692a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> (cherry picked from commit 50a900e509be2e1f448f29be126ba3b7f8173901)
* | | C++: add support for local typesPrzemyslaw Gorszkowski2013-06-181-2/+112
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change addes support for class, enum definition inside blocks({}) or functions, e.g.: void f() { struct S { int bar; }; S s; s.bar; } It fixes: * code completion * highlighting * follow symbol * marking * find usages It fixes also problem with namespace aliases inside blocks or functions. This change can have also impact on performance(there are additional processing) Task-number: QTCREATORBUG-166 (namespace aliases inside function/block) Task-number: QTCREATORBUG-3620 Task-number: QTCREATORBUG-6013 Task-number: QTCREATORBUG-8020 Change-Id: Iaea6c6dfe276f1d7b2279b50bdd2e68e375d31eb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Handle recursive using/typedef declarationsNikolai Kosjar2013-06-111-3/+10
| | | | | | | | | | | | | | | | Remember using/typedef declarations we have already looked up and stop if we try it again. Change-Id: I91bf0aef4df18539a47d015f0113543aef1f692a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Record also unresolved paths for includesNikolai Kosjar2013-06-111-1/+1
| | | | | | | | | | Change-Id: Id107b6c1f34f594c5a01502c156963c964235ed7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: instantiate template functionsPrzemyslaw Gorszkowski2013-05-241-0/+36
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-9170 Change-Id: I4cac9124558c1d4f0722192246f3fbeea61d3d7d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Fix crash for nameless using declarationNikolai Kosjar2013-05-241-14/+18
| | | | | | | | | | | | Task-number: QTCREATORBUG-9323 Change-Id: I52dfe8c03da14fc08723c3878fec0f6e9150152c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge branch '2.7'Oswald Buddenhagen2013-05-151-34/+21
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/qtquick/qtquick-components.qdoc doc/src/qtquick/qtquick-designer.qdoc qtcreator.pri qtcreator.qbs src/plugins/cppeditor/cppinsertdecldef.cpp src/plugins/qnx/qnxruncontrolfactory.cpp Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
| * C++: Fix crash in code completion.Erik Verbruggen2013-05-031-34/+21
| | | | | | | | | | | | | | | | | | | | Caused by a dangling pointer of a template instantiation which had been cloned into the wrong control. The fix is to remove that control and refer to the control of the bindings (which is the correct one). Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix highlighting type when there is using Namespace::ClassPrzemyslaw Gorszkowski2013-05-021-3/+38
| | | | | | | | | | | | | | | | | | If type is not found we try to find 'using' declaration for this type. Task-number: QTCREATORBUG-7903 Change-Id: I569db9e1a8504a5da3115ebbed2e823d5924f6ca Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix code completion when 'using' declaration inside functionPrzemyslaw Gorszkowski2013-05-021-0/+9
| | | | | | | | | | | | | | | | Looking for using declaration when lookup a type Task-number: QTCREATORBUG-2668 Change-Id: I11600c5be262840472dd4c9e72334760a35aa4a0 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Revert "C++: fix support for typedef of templated typedefs"Nikolai Kosjar2013-04-231-64/+3
| | | | | | | | | | | | | | | | | | | | Still crashes when opening the Qt Creator project, g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2 (Ubuntu 12.10). This reverts commit 564c9b2842663062658a0febdcc5787098d871b2. Change-Id: Ief5c0aad463d245f68805f747d277ac298796c3d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: fix support for typedef of templated typedefsPrzemyslaw Gorszkowski2013-04-221-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | Fix: * code completion * follow symbols * find usages Task-number: QTCREATORBUG-8375 Change-Id: Ia40273fec3dead76acad4695b852a9e53065d8a7 Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Revert "C++: fix support for typedef of templated typedefs"Erik Verbruggen2013-04-191-52/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Infinite recursion in the lookup of: struct common_type { public: typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type; }; This reverts commit 9a56ce4e85bec81c521258f44e9076d0bc9cce92 Change-Id: I675fe39018789cd04127d105eb983d2cb7798ca5 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: fix support for typedef of templated typedefsPrzemyslaw Gorszkowski2013-04-191-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | Fix: * code completion * follow symbols * find usages Task-number: QTCREATORBUG-8375 Change-Id: I6f35e809ba15f224c5a6d9b2fcfc18dbfba55411 Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: improve support for anonymous classesPrzemyslaw Gorszkowski2013-04-191-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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++: fix cloning of templatesPrzemyslaw Gorszkowski2013-04-171-0/+2
| | | | | | | | | | | | | | | | | | Fix instantiation of templates(by cloning original symbols). Assigning of scope for cloned symbol is taken from the symbol which is used to instantiate. Task-number: QTCREATORBUG-9098 Change-Id: I066cc8b5f69333fabdaf2d4466b205baf08bd3f1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-04-111-20/+36
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppchecksymbols.h src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
| * C++: fixed code completion for namespace aliasesPrzemyslaw Gorszkowski2013-04-101-1/+2
| | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-166 Change-Id: I7a19065a57bfb943e5fc4e2bd9bd81988c1175e3 Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * C++: name of function of class problemPrzemyslaw Gorszkowski2013-04-101-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes: * highlighing * find usage * follow symbol when function of class has the same name as: * local variable * template parameter * other struct/union/class/enum * function argument in function scope. Task-number: QTCREATORBUG-8902 Change-Id: Iddc0f764af689babb40d39460d174bac7b919b31 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * C++: fixed operator arrow of nested class of enclosing templatePrzemyslaw Gorszkowski2013-04-101-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixed: * code completion * highlighting * find usage * follow symbol Task-number: QTCREATORBUG-9005 Change-Id: I3fcc2638482ca1071c1aa7b6aab0d4dd128595bb Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-6/+7
| | | | | | | | | | | | | | | | | | | | | | ... and adjust INCLUDEPATH accordingly. while i'm at messing with include statements, also re-order the include blocks according to policy and sort them within bigger blocks. Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-03-081-20/+58
|\ \ | |/ | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs Change-Id: Ie71d0d5aebdd1406d94de348bcd4cfcc203a1ba9
| * C++: cache fully qualified name lookupus in scopes.Erik Verbruggen2013-03-051-20/+58
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-8724 Change-Id: I00b0712cf5514bcec04b674052ad4b5b66cca506 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.7'Oswald Buddenhagen2013-02-281-4/+67
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/qnx/blackberrydeployconfiguration.cpp Change-Id: I16d1c7717f4bc25ba7e8dbdd5be6580fafe3f33d
| * C++: performance improvement for template instantiationPrzemyslaw Gorszkowski2013-02-271-2/+9
| | | | | | | | | | | | | | Add cache for instantiated instantiations in base template class. Change-Id: I5c457ea4dfeab72cc3910f0092ca1bc14b8aa1ac Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * C++: fix 'using' for templates in typedefsPrzemyslaw Gorszkowski2013-02-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fix resolving typedef of templates which is from different namespace and there was 'using' used for it. Examples are in tests. Another step to bring code completion for stl containters. Task-number: QTCREATORBUG-7978 Change-Id: I2e9e71b45d60536c1e25cf2d371c4719b15edf79 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * C++: fix instantiation of template special. with pointer argumentPrzemyslaw Gorszkowski2013-02-211-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed code completion for instantiation of template specialization with argument as pointer, e.g.: template <typename T> struct Template { T variable; }; template <typename T> struct Template<T *> { T *pointer; }; Template<int*> templ; templ.pointer; Change-Id: I7c79fe0cd7119b1208f064aece0cafdf50e1a012 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
| * C++: fixed resolving complex typedefPrzemyslaw Gorszkowski2013-02-201-0/+11
| | | | | | | | | | | | | | | | Unit test describe this complex typedef. Another step to bring code completion for stl containers. Change-Id: I27985c4ea7c26c723d7a88ce42c5ecf164b6c903 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Qt5: Don't use the deprecated {QString,QChar}::fromAscii()Debao Zhang2013-02-261-1/+1
|/ | | | | | Change-Id: Ic1d302c2186b11ffec5139f4f491d477d334ec8f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: instantiate template with default argumentPrzemyslaw Gorszkowski2013-02-011-12/+21
| | | | | | | | Fix code completion for instantiation of template with default argument Change-Id: I57b0306cc4540400ae83724db6c8b6b1aa67c255 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * C++: Fix code completion for Qt containersPrzemyslaw Gorszkowski2012-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change solves only problem with Qt containers. stl containers need separate change. Problem was with predeclaration of template class after declaration of this template class. (there is unit test added which shows the problem). Task-number: QTCREATORBUG-8228 (cover only Qt containers) Change-Id: If1f76c88c955b7b55347d302b353f5cd52b244a4 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Conflicts: src/plugins/cpptools/cppcompletion_test.cpp Change-Id: I9f665276926f2e440ad0c92e94dd1aeee89005b3 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | C++: Fix code compl. for instantiation of template specializationPrzemyslaw Gorszkowski2013-01-301-5/+36
| | | | | | | | | | | | | | | | | | | | | | It works for full specialization. Instantiate of the partial specialization has to be implemented(finding appropriate partial specialization-on going) Added unit test. Change-Id: I8ef5ea963e7c665e0d67d390b3a833486773dab0 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++ editor: Highlighting static variablesPrzemyslaw Gorszkowski2013-01-291-0/+4
| | | | | | | | | | | | | | | | | | Fix highlighting, find usages, marking for static variables. Task-number: QTCREATORBUG-6822 Change-Id: I0c97c93c6c1024550907eec3820496df22a94e85 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Remove braces for single lines of conditionsOrgad Shaneh2013-01-081-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/env ruby Dir.glob('**/*.cpp') { |file| # skip ast (excluding paste, astpath, and canv'ast'imer) next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i s = File.read(file) next if s.include?('qlalr') orig = s.dup s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m| res = $& if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces res else res.gsub!('} else', 'else') res.gsub!(/\n +} *\n/m, "\n") res.gsub(/ *{$/, '') end } s.gsub!(/ *$/, '') File.open(file, 'wb').write(s) if s != orig } Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc Reviewed-by: hjk <qthjk@ovi.com>