summaryrefslogtreecommitdiff
path: root/tests/auto/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
...
* C++: Safe accessing of elements of TranslationUnit::_tokensNikolai Kosjar2013-10-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now std::vector::at() was used to access the elements. This is handy for debugging since an exception is thrown for invalid indices, but it does not stop Qt Creator from crashing because exceptions are not caught. This is especially a problem for the parser, which has to look ahead via LA(n), which accesses TranslationUnit::_tokens. With this patch, explicit bounds checking is done before accessing the elements and thus calls to std::vector::at() // bounds checking, throwing out_of_range were replaced by calls to std::vector::operator[]() // no bounds checking, not throwing out_of_range Measuring the parse time for the Qt Creator project shows that there is no slowdown. In both cases, with and without the patch, about 15s are needed on the authors machine. Task-number: QTCREATORBUG-10453 Change-Id: I32b12a526ff7199bcadfc21a3deb5354063a3e3b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Comment out debug logOrgad Shaneh2013-10-161-1/+1
| | | | | | | Uncommented in e088541c0 Change-Id: Ia9685b815523ab61a8780e9f5686a5d713eec842 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CPlusPlus: Make (sub-)languague selection more generichjk2013-10-153-11/+18
| | | | | Change-Id: I4e2df6992b446adec662ab07671acd41715e41fd Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Parse MEMBER in Q_PROPERTY()Nikolai Kosjar2013-10-091-0/+37
| | | | | | | | | MEMBER was added in Qt5. Task-number: QTCREATORBUG-10068 Change-Id: Ic6c15a0e5ee8981ab98e4c12fc1521dc281b731f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Add qbs project files for autotests.Christian Kandeler2013-09-0914-0/+160
| | | | | | | | | | Note: Since not all autotests are able to run from an installed location, we need to be able to start them from the build directory, which in turn forces us to set a destination directory for libraries and plugins, so they will be found at run-time. Change-Id: Idcf7e1333dfa6e9dbf745391b78c035f842ccc5a Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* C++: Tests: Fix tst_Semantic::lambda_2() testNikolai Kosjar2013-09-061-1/+1
| | | | | Change-Id: Ie405a9339d13615efb1113614a7dcd7069849b4f Reviewed-by: David Schulz <david.schulz@digia.com>
* CPlusPlus: Some compile fixes for autotests.Christian Kandeler2013-08-263-2/+5
| | | | | Change-Id: Id2ced5e41686387e67a7bb8419fe1547b23779c7 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Tests: Reset diagnostic messagesNikolai Kosjar2013-08-221-0/+6
| | | | | | | | | | | | | | ...otherwise they add up and subsequent tests checking for the error count will fail: FAIL! : tst_AST::objc_try_statement_1() Compared values are not the same Actual (diag.errorCount): 5 Expected (0): 0 Loc: [/home/nikolai/dev/creator/qtcreator-master/tests/auto/cplusplus/ast/tst_ast.cpp(1400)] ... Change-Id: I8b4356331e95dceb1e99bb26e6ebf4591d70a08c Reviewed-by: David Schulz <david.schulz@digia.com>
* C++: Add parser support for @throw statements.Erik Verbruggen2013-08-211-0/+17
| | | | | Change-Id: I366733ec821ee264f182f4d4a3cf69cdada20cfc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Merge remote-tracking branch 'origin/2.8'Oswald Buddenhagen2013-08-211-0/+8
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppcompletion_test.cpp src/plugins/cpptools/cpptoolsplugin.h src/plugins/projectexplorer/customtoolchain.cpp src/plugins/vcsbase/command.cpp Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
| * Debugger: Implement dumper for std::unordered_{set,map}hjk2013-08-161-0/+8
| | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-9855 Change-Id: I985745530d93e1c191442431a7a9449a1c4c059a Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: David Schulz <david.schulz@digia.com>
* | C++: fix matching type with using from other namespacePrzemyslaw Gorszkowski2013-08-202-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | C++: handle @try statements in the parser.Erik Verbruggen2013-07-191-0/+57
| | | | | | | | | | | | | | | | | | No semantic analysis yet, but this prevents the parser from generating bogus diagnostics. Task-number: QTCREATORBUG-9309 Change-Id: I2ec575a8474cd51bfa97b17678d3da71ab8dcd7a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: add test for TranslationUnit::getPosition bugErik Verbruggen2013-07-151-0/+18
| | | | | | | | | | | | | | | | | | | | This test is marked as failing, because the bug is still there. To be fixed when we re-use the generated token stream of the preprocessor as input for the parser. Task-number: QTCREATORBUG-9799 Change-Id: I454a9939aa188a6ff934a11699232f39c828bc7b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: add utility method to dump usages.Erik Verbruggen2013-07-111-0/+17
| | | | | | | | | | Change-Id: Icff6e9310a45e66b573fb2a6623a10e025c43539 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: Fix test failure after merging 2.8.Erik Verbruggen2013-07-111-1/+1
| | | | | | | | | | | | Change-Id: Iac4156b872fe81c1714857c24363bf171e7d61cd Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.8' into HEADEike Ziller2013-07-091-0/+31
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: src/libs/cplusplus/FindUsages.cpp tests/auto/cplusplus/findusages/tst_findusages.cpp tests/auto/debugger/tst_dumpers.cpp Change-Id: I20e2002c7b25cc25d8120922fa9b52e59db498e3
| * C++: fix scope matching for templates in FindUsagesErik Verbruggen2013-07-081-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the cursor is on the name of declaration of a templated function, then since f93758b8e1d68ed28dc1a84b71c906d58784cb70 the scope returned by Document::findScopeAt is the scope of the template declaration. Before it was the parent scope of the template declaration. The check in FindUsages::checkCandidates did not check all combinations of template(-child symbol) scopes for the searched symbol and its occurrences. Task-number: QTCREATORBUG-9749 Change-Id: Idc84a2ba718721ce54683a67635a93352784ddd1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.8' into HEADEike Ziller2013-07-081-0/+7
|\ \ | |/ | | | | | | | | | | Conflicts: qbs/pluginspec/pluginspec.qbs Change-Id: Ic8e992623b9eda8913ee473c779a8df27643ccc9
| * CppRewriter: Treat libc++'s std::__1:: as std:: for debugger displayhjk2013-07-081-0/+7
| | | | | | | | | | | | Change-Id: Iabc1330633e5568b7c94059d4286c93adfecb1a2 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Merge remote-tracking branch 'origin/2.8' into HEADEike Ziller2013-07-031-1/+29
|\ \ | |/ | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs Change-Id: I5d2018d3437b99bcdffa92bf1a212f42923c4fad
| * CDB: fix breakpoint location in catch clauses.Erik Verbruggen2013-07-021-1/+29
| | | | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-7336 Change-Id: I926e82499325e4fe38e25cc7a6158050f7fc0e82 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.8'Eike Ziller2013-06-251-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/fakevim/fakevimhandler.cpp Change-Id: I8101f18b87859924644471817d4f1408790d5628
| * CppEditor: Check <include path>/QSomethingNikolai Kosjar2013-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | For the quick fix AddIncludeForUndefinedIdentifier, if no class is found via the locator, check the "Qt include paths" for a header file with the same name as the class name. Task-number: QTCREATORBUG-9538 Change-Id: I13c86844c2ff653fa479dc91eb109af2a6d76fae Reviewed-by: Lorenz Haas <lykurg@gmail.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | C++: add support for local typesPrzemyslaw Gorszkowski2013-06-181-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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++: fix 'find usages' for templatesPrzemyslaw Gorszkowski2013-06-171-1/+113
|/ | | | | | | | | | | | | Fix find usages for template class(class name and template parameters) or template function(template parameters). Fixed: * marking * find usages * follow symbol Change-Id: I22fdbc11260cbd8ee9aafdd76aaeee0f4f49f9fd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix preprocessor blocked macro bug.Erik Verbruggen2013-06-113-0/+20
| | | | | | | | | | | | | | | | By lexing the first token after a macro call (meaning: the token after the closing parenthesis (which was passed to handleFunctionLikeMacro which in turn pushed it back into the token buffer)), a token buffer might be popped, which unblocks the macro that generated the actual param pack. The effect was that if this happens in the expansion of a recursive macro (with parameters!), the preprocessor ended up in an infinite loop. Task-number: QTCREATORBUG-9015 Task-number: QTCREATORBUG-9447 Change-Id: I0d83c59188ec15c4a948970e9fa944a17d765475 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppEditor: Improve finding position for new includesNikolai Kosjar2013-06-1128-0/+28
| | | | | | | | | ...by detecting include groups (separated by new lines, include types and same dir prefix). Task-number: QTCREATORBUG-9317 Change-Id: I73e80fdc715104901cb2d4f5b15b4cab5d04d305 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: add semantic support for C++11 alias decls.Erik Verbruggen2013-06-062-0/+36
| | | | | | | Task-number: QTCREATORBUG-9386 Change-Id: Ia68f3866c122ca5261dd73b2c740b47fb15744fc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix functionAt(), moved it, and added test.Erik Verbruggen2013-06-041-0/+25
| | | | | | | Thanks to Jesper K. Pedersen for the fix! Change-Id: Ie49c3352e26a9632b1500596b00d559bfe932dff Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: handle braced return statements in indenter.Erik Verbruggen2013-06-031-0/+14
| | | | | | | Task-number: QTCREATORBUG-9314 Change-Id: I59c026cce02b85eeb54f4d10d5c9fb0c59bfe28a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: do not strip trailing newlines in the preprocessor output.Erik Verbruggen2013-05-304-3/+91
| | | | | | | | | | | | | Doing so resulted in an incorrect position for the EOF token when the preprocessed output would be parsed. That in turn leads to incorrect insertion positions for refactoring actions. This is especially true when a file contains only preprocessor directives: the EOF token would point to line 1 column 1, which is usually not the place where code should be inserted. Change-Id: I7d359aa7a6c04bc52c8b873fd49ad6afc3a77319 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: fix used template function parametersPrzemyslaw Gorszkowski2013-05-241-0/+27
| | | | | | | | | | | It was missing colorizing and follow symbol template function parameters in case of: * returning value * use it as qualified name Task-number: QTCREATORBUG-6861 Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: instantiate template functionsPrzemyslaw Gorszkowski2013-05-241-1/+0
| | | | | | | 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-0/+74
| | | | | | Task-number: QTCREATORBUG-9323 Change-Id: I52dfe8c03da14fc08723c3878fec0f6e9150152c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix unused field warnings in test.Erik Verbruggen2013-05-151-0/+2
| | | | | Change-Id: I898668a91eb7d3fa18c0a8d3e7e7507f0fb5a917 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Merge branch '2.7'Oswald Buddenhagen2013-05-151-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | 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-022-0/+211
| | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-04-301-0/+18
|\ \ | |/ | | | | | | | | | | Conflicts: src/plugins/qmldesigner/components/formeditor/abstractcustomtool.cpp Change-Id: I4e0a85795e7f4bfcdc21d106517517b527f85104
| * C++: fix handling of empty va_args macro arguments.Francois Ferrand2013-04-291-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | Preprocessor did not correctly handle when variadic macro arguments were not provided at all, if there were other arguments: macro was not expanded in case only the non variadic arguments were given. #define MACRO(...) used to work fine for 0 or more arguments. #define MACRO(ARG0, ...) used to work only for 2 or more arguments, now fixed. Change-Id: I64e9199ceccae05618a49931c2adad8e4f9471ba Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: improve support for anonymous classesPrzemyslaw Gorszkowski2013-04-192-1/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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++: replace Q_UNREACHABLE by QTest::qFail.Erik Verbruggen2013-04-181-1/+2
| | | | | | | | | | | | | | | | | | Q_UNREACHABLE was introduced in Qt5, so using it impossible to compile the tests with Qt4. Change-Id: I0ed23ad9390b1428513a7a0c975dd8fb72efb001 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: highlighter clean-upsErik Verbruggen2013-04-181-660/+662
| | | | | | | | | | | | | | | | | | - Moved TextEditor::SemanticHighlighter::Result to TextEditor::HighlightingResult - Moved SemanticInfo::UseKind to CppHighlightingSupport::Kind Change-Id: I14faab1891ca691a0691cfd9243edf19fcd3d3df Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: fix cloning of templatesPrzemyslaw Gorszkowski2013-04-171-0/+39
| | | | | | | | | | | | | | | | | | 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>
* | C++: fix highlighting for template parameters for function calls.Erik Verbruggen2013-04-161-0/+28
| | | | | | | | | | Change-Id: Ie0133893d8b8d35ea2aa599cb8f7d5c2cc55271e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-04-112-0/+248
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppchecksymbols.h src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
| * C++: name of function of class problemPrzemyslaw Gorszkowski2013-04-101-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * C++: fixed operator* for nested class of enclosing template classPrzemyslaw Gorszkowski2013-04-092-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed: * highlighting * follow symbol * find usage Task-number: QTCREATORBUG-9006 Change-Id: I34a42f8665335857f41290217e7265e8a752455b Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>