summaryrefslogtreecommitdiff
path: root/tests/auto/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'Eike Ziller2015-02-1214-84/+84
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/tooltip/tipcontents.cpp src/libs/utils/tooltip/tipcontents.h src/plugins/android/androiddeployqtstep.cpp src/plugins/baremetal/baremetalconstants.h src/plugins/baremetal/baremetaldevice.cpp src/plugins/baremetal/baremetaldevice.h src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp src/plugins/baremetal/baremetaldeviceconfigurationwidget.h src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h src/plugins/baremetal/baremetalplugin.cpp src/plugins/baremetal/baremetalplugin.h src/plugins/baremetal/baremetalruncontrolfactory.cpp src/plugins/baremetal/baremetalruncontrolfactory.h src/plugins/cppeditor/cppcodemodelinspectordialog.cpp src/plugins/cppeditor/cppdoxygen_test.cpp src/plugins/cppeditor/cppdoxygen_test.h src/plugins/debugger/breakpointmarker.cpp src/plugins/debugger/debuggeritemmodel.cpp src/plugins/debugger/debuggeritemmodel.h src/plugins/debugger/loadcoredialog.cpp src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp src/plugins/projectexplorer/addnewmodel.cpp src/plugins/projectexplorer/addnewmodel.h src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp src/plugins/qmlprofiler/abstracttimelinemodel.cpp src/plugins/qmlprofiler/abstracttimelinemodel.h src/plugins/qmlprofiler/notesmodel.cpp src/plugins/qmlprofiler/qml/CategoryLabel.qml src/plugins/qmlprofiler/qml/MainView.qml src/plugins/qmlprofiler/qml/Overview.js src/plugins/qmlprofiler/qml/Overview.qml src/plugins/qmlprofiler/qml/TimeDisplay.qml src/plugins/qmlprofiler/qml/TimeMarks.qml src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp src/plugins/qmlprofiler/sortedtimelinemodel.cpp src/plugins/qmlprofiler/sortedtimelinemodel.h src/plugins/qmlprofiler/timelinemodelaggregator.cpp src/plugins/qmlprofiler/timelinemodelaggregator.h src/plugins/qmlprofiler/timelinerenderer.cpp src/plugins/qmlprofiler/timelinerenderer.h src/plugins/qmlprojectmanager/QmlProjectManager.json.in src/plugins/texteditor/findinfiles.cpp src/plugins/vcsbase/vcsconfigurationpage.cpp src/shared/qbs src/shared/scriptwrapper/interface_wrap_helpers.h src/shared/scriptwrapper/wrap_helpers.h tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp tests/system/suite_debugger/tst_debug_empty_main/test.py tests/system/suite_debugger/tst_qml_js_console/test.py tests/system/suite_debugger/tst_qml_locals/test.py Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
| * Update LicenseEike Ziller2015-01-1614-84/+84
| | | | | | | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Cache parsing of template idsNikolai Kosjar2015-02-121-4/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...in order to stop memory intensive parsing for invalid code. Parsing the test data/snippet "hard" led to a memory consumption of about 5.5MB and this could easily get up to hundreds/gigabytes by adding some more "if_<bool_<true>,\n" lines. With the caching, we are at about 1.0MB, even if more lines are added. The "memory consumption" was measured with valgrind-massif. The stated numbers are the reported peaks. Task-number: QTCREATORBUG-12890 Change-Id: Ie7eb00cfc7915552d29bb27410a6b13a486f486e Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Remove workaround for crashing if parsing invalid codeNikolai Kosjar2015-02-121-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts the changes commit beac7b9539457fe721de1709b9a406cac2379851 C++: Fix highlighting after "invalid code" commit 78ab287fc6d3770646012e461b0a518db4e9c9f4 C++: Stop parsing a declaration after two tries which were a work around for QTCREATORBUG-12890. A follow-up patch provides a proper fix. Task-number: QTCREATORBUG-12890 Change-Id: I2650a8e41c8ff1180cad9f069e463fc51bd2f1b1 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Remove unneeded qualificationsOrgad Shaneh2015-02-043-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly done using the following ruby script: Dir.glob('**/*.cpp').each { |file| next if file =~ %r{src/shared/qbs|/qmljs/} s = File.read(file) s.scan(/^using namespace (.*);$/) { ns = $1 t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m| before = $1 char = $2 if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/ m else before + char end } if t != s puts file File.open(file, 'w').write(t) end } } Change-Id: I6fbe13ddc1485efe95c3156097bf41d90c0febac Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: Expand arguments in nested function-like macrosOrgad Shaneh2015-01-211-5/+11
| | | | | | | | | | | | Task-number: QTCREATORBUG-13219 Change-Id: I319fe39d696ccc28230d421b1395faf4dd452b03 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* | C++: display enum value in tooltip for simplest casePrzemyslaw Gorszkowski2015-01-141-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If it is possible lets calculate enum value for the simplest case. Example where it works: enum { enum_val1, // tooltip = "enum_val1 = 0" enum_val2 // tooltip = "enum_val2 = 1" }; enum { enum_val1=10, // tooltip = "enum_val1 = 10" enum_val2 // tooltip = "enum_val2 = 11" }; enum { enum_val1, // tooltip = "enum_val1 = 0" enum_val2=10, // tooltip = "enum_val2 = 10" enum_val3 // tooltip = "enum_val3 = 11" }; Example where it does not work: enum { enum_val1=10+1, // tooltip = "enum_val1 = 10+1" enum_val2 // tooltip = "enum_val2" }; Task-number: QTCREATORBUG-4529 Change-Id: Idd85ed7304018f73f2b068bf1ac28f1abde02f93 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* | Tests: Fix MSVC warningsOrgad Shaneh2015-01-131-0/+1
| | | | | | | | | | | | Change-Id: If7f67ffc68ef725554e9ebaf8a8db5a64b7309cb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: hjk <hjk@theqtcompany.com>
* | CppTools: Tests: Stop writing into source dirNikolai Kosjar2014-12-196-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, always write into a unique temporary directory in QDir::tempPath(). Where applicable, read the test source from files instead of first writing the file. Some clean ups in test_codegen*. Change-Id: Id48dc50c6ca16252edfd9fc8a86ba0de9f9be486 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: clean up numeric literal parsing and add support for n3472.Erik Verbruggen2014-12-181-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | Separate the messy pp-number parsing from the numeric literal parsing. The C/C++ preprocessor makes a grown man cry, but at least we have "proper" literal parsing when we want it, including C++1y binary literals. Next step is digit separators (n3781). Change-Id: Ia069eef454ed5c056f77694a5b8a595d0b76adc4 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | C++: Finish gcc's include_next supportNikolai Kosjar2014-12-153-0/+20
|/ | | | | | | | | | | | | | | | | This implements the actual include_next logic and thus completes commit b934cc1 C++: pass #include_next down to CppPreprocessor::tryIncludeFile commmit 140b502 C++: Highlight argument to gcc's #include_next extension Based on https://gcc.gnu.org/onlinedocs/cpp/Wrapper-Headers.html Task-number: QTCREATORBUG-10225 Change-Id: I7eef7f5ea64a114f6d092304d32b72c55c2ce134 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* CppEditor: Avoid duplicate "Add #include XYZ"Nikolai Kosjar2014-11-281-0/+3
| | | | | | Task-number: QTCREATORBUG-13422 Change-Id: I3648bf44760fdac4e8e1e79652519136af6032c8 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* C++: Fix highlighting after "invalid code"Nikolai Kosjar2014-11-191-1/+26
| | | | | | | | | | | | | | | For the semantic info document we do not expand function like macros and because of that certain macro invocations lead to invalid code that we need to handle, e.g.: Q_GLOBAL_STATIC(CppTools::SymbolFinder, symbolFinder) class Foo {}; This change makes parsing Foo in the semantic info document successfully again, which affects highlighting of that class. Change-Id: I389265ac64d3f0b8b8f406d38fa58d78820b14ba Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* C++: Document::functionAt provides line informationNikolai Kosjar2014-11-121-11/+29
| | | | | | | Needed for the debugger. Change-Id: I6465f6dc53017df212e403ea8a9a1c7977ac1671 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: Include class name for inline functions in functionAtNikolai Kosjar2014-11-111-7/+20
| | | | | | | | | | The code that constructed the fully qualified name used enclosingNamespace() which skips classes. Use LookupContext::fullyQualifiedName() instead. Change-Id: Ic03a91c0fe120c52dc69f3e78e82a574458d8314 Reviewed-by: hjk <hjk121@nokiamail.com>
* C++: Tests: Make document_functionAt data drivenNikolai Kosjar2014-11-111-10/+27
| | | | | Change-Id: I8e811b21c584e7b6a2b8eb61830cb680f6fefa95 Reviewed-by: hjk <hjk121@nokiamail.com>
* qbs build: Remove unneeded import statements.Christian Kandeler2014-11-101-1/+0
| | | | | | | The respective items are available without it. Change-Id: Idc840cf08e7bec84f561c096afe8de25b1fb8468 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* C++: Add a failing test for pp concat bugOrgad Shaneh2014-11-071-0/+27
| | | | | | Task-number: QTCREATORBUG-13219 Change-Id: I6278d7977f0ce560e793838c90cfbc867e1af025 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Tests: Fix compilationOrgad Shaneh2014-11-071-27/+26
| | | | | | | Broken by ca151d07fa6d97039fed95dcabe206fce41f5769. Change-Id: Ic6b58b5749d5811d1250840c81d692837e9a2cea Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix parsing of "Foo *foo = new Foo()"Nikolai Kosjar2014-10-151-3/+27
| | | | | | | | | | | | | | | | | | | It should be parsed as an DeclarationStatement, but instead it was parsed as an ExpressionStatement. Regression introduced with commit d3c5fff66de034e46e825b63943909d36067405f. C++: Fix expensive parsing of expressions The introduced ASTCache did not save the correct return value of a parse* function. Because of that, the first return in Parser::parseExpressionList returned false on the second invocation (cache hit), instead of true, which resulted in an ExpressionStatement. Task-number: QTCREATORBUG-13122 Change-Id: I8dbd8852b0909edddcd3195b484f4cea92328cc5 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-10-1414-98/+112
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/ipaddresslineedit.cpp src/libs/utils/logging.h src/plugins/analyzerbase/AnalyzerBase.pluginspec.in src/plugins/android/Android.pluginspec.in src/plugins/android/androiddeploystep.cpp src/plugins/android/androiddeploystep.h src/plugins/android/androiddeploystepfactory.cpp src/plugins/android/androiddeploystepwidget.cpp src/plugins/android/androidpackagecreationfactory.cpp src/plugins/android/androidpackagecreationstep.cpp src/plugins/android/androidpackagecreationstep.h src/plugins/android/androidpackagecreationwidget.cpp src/plugins/android/androidpackagecreationwidget.h src/plugins/android/javafilewizard.cpp src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/baremetal/BareMetal.pluginspec.in src/plugins/bazaar/Bazaar.pluginspec.in src/plugins/beautifier/Beautifier.pluginspec.in src/plugins/bineditor/BinEditor.pluginspec.in src/plugins/bookmarks/Bookmarks.pluginspec.in src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in src/plugins/clangcodemodel/clanghighlightingsupport.cpp src/plugins/clangcodemodel/clangsymbolsearcher.cpp src/plugins/classview/ClassView.pluginspec.in src/plugins/clearcase/ClearCase.pluginspec.in src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp src/plugins/cmakeprojectmanager/cmakehighlighter.cpp src/plugins/coreplugin/Core.pluginspec.in src/plugins/cpaster/CodePaster.pluginspec.in src/plugins/cppeditor/CppEditor.pluginspec.in src/plugins/cppeditor/cppfilewizard.cpp src/plugins/cpptools/CppTools.pluginspec.in src/plugins/cpptools/cpphighlightingsupportinternal.cpp src/plugins/cpptools/cppmodelmanagerinterface.cpp src/plugins/cpptools/cppmodelmanagerinterface.h src/plugins/cvs/CVS.pluginspec.in src/plugins/debugger/Debugger.pluginspec.in src/plugins/designer/Designer.pluginspec.in src/plugins/diffeditor/DiffEditor.pluginspec.in src/plugins/emacskeys/EmacsKeys.pluginspec.in src/plugins/fakevim/FakeVim.pluginspec.in src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in src/plugins/git/Git.pluginspec.in src/plugins/git/gitorious/gitorious.cpp src/plugins/git/gitorious/gitorious.h src/plugins/git/gitorious/gitoriousclonewizard.cpp src/plugins/git/gitorious/gitorioushostwidget.cpp src/plugins/git/gitorious/gitorioushostwidget.h src/plugins/git/gitorious/gitorioushostwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwidget.cpp src/plugins/git/gitorious/gitoriousprojectwidget.h src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwizardpage.h src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp src/plugins/git/gitorious/gitoriousrepositorywizardpage.h src/plugins/glsleditor/GLSLEditor.pluginspec.in src/plugins/glsleditor/glsleditorfactory.cpp src/plugins/glsleditor/glslfilewizard.cpp src/plugins/helloworld/HelloWorld.pluginspec.in src/plugins/help/Help.pluginspec.in src/plugins/imageviewer/ImageViewer.pluginspec.in src/plugins/ios/Ios.pluginspec.in src/plugins/macros/Macros.pluginspec.in src/plugins/mercurial/Mercurial.pluginspec.in src/plugins/perforce/Perforce.pluginspec.in src/plugins/projectexplorer/ProjectExplorer.pluginspec.in src/plugins/pythoneditor/PythonEditor.pluginspec.in src/plugins/pythoneditor/pythoneditorwidget.cpp src/plugins/pythoneditor/wizard/pythonfilewizard.cpp src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in src/plugins/qmakeprojectmanager/profileeditorfactory.cpp src/plugins/qmldesigner/QmlDesigner.pluginspec.in src/plugins/qmljseditor/QmlJSEditor.pluginspec.in src/plugins/qmljseditor/qmljseditorfactory.cpp src/plugins/qmljstools/QmlJSTools.pluginspec.in src/plugins/qmlprofiler/QmlProfiler.pluginspec.in src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in src/plugins/qnx/Qnx.pluginspec.in src/plugins/qtsupport/QtSupport.pluginspec.in src/plugins/remotelinux/RemoteLinux.pluginspec.in src/plugins/resourceeditor/ResourceEditor.pluginspec.in src/plugins/resourceeditor/resourcewizard.h src/plugins/subversion/Subversion.pluginspec.in src/plugins/tasklist/TaskList.pluginspec.in src/plugins/texteditor/TextEditor.pluginspec.in src/plugins/texteditor/basetexteditor_p.h src/plugins/texteditor/basetextmark.cpp src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h src/plugins/texteditor/codeassist/defaultassistinterface.h src/plugins/texteditor/codeassist/iassistproposalitem.cpp src/plugins/texteditor/itexteditor.cpp src/plugins/texteditor/itexteditor.h src/plugins/texteditor/itextmark.cpp src/plugins/texteditor/plaintexteditor.cpp src/plugins/texteditor/plaintexteditor.h src/plugins/texteditor/texteditoractionhandler.cpp src/plugins/todo/Todo.pluginspec.in src/plugins/updateinfo/UpdateInfo.pluginspec.in src/plugins/valgrind/Valgrind.pluginspec.in src/plugins/vcsbase/VcsBase.pluginspec.in src/plugins/welcome/Welcome.pluginspec.in src/plugins/winrt/WinRt.pluginspec.in tests/auto/debugger/temporarydir.h Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
| * License updateEike Ziller2014-10-0914-98/+112
| | | | | | | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | C++: Pass on the byte offsets of macro argumentsNikolai Kosjar2014-10-081-1/+75
| | | | | | | | | | | | | | | | ...to the Document/Block. Change-Id: I1a96dc70ac93254e6030326b36a5df9a2cdc2bd8 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: Fix endless loop in lookup on WindowsNikolai Kosjar2014-09-251-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...for templates with typedefs referencing the respectively other template (basic_ostream <-> ostreambuf_iterator). Tested with MSVC 2013. Regression introduced by ba42ceb0cb7827a9bbad29a1e08d4a25339ea57d. Task-number: QTCREATORBUG-13064 Task-number: QTCREATORBUG-13065 Change-Id: I71a45c720663a73c3302eb7da731e6ad2d8f0fbd Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
* | C++: Tests: Extract some functions in tst_checksymbolsNikolai Kosjar2014-09-251-18/+33
| | | | | | | | | | | | | | ...so we can use them in a follow-up change. Change-Id: I0ddc5bb966e72ab5c527f6814650d70492bbbdb5 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* | use DISTFILES instead of OTHER_FILES in creator's own build systemOswald Buddenhagen2014-09-153-3/+3
| | | | | | | | | | | | | | it's the correct variable to use. Change-Id: I9ec7795099097715a64969516cd3fae9e213a0f4 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
* | C++: Base parsing on editor document instead of widgetNikolai Kosjar2014-08-251-38/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mainly takes CppEditorSupport apart. * Parsing is now invoked by CPPEditorDocument itself by listening to QTextDocument::contentsChanged(). * Upon construction and destruction CPPEditorDocument creates and deletes an EditorDocumentHandle for (un)registration in the model manager. This handle provides everything to generate the working copy and to access the editor document processor. * A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that controls parsing, semantic info recalculation and the semantic highlighting for the document. This is more or less what is left from CppEditorSupport and can be considered as the backend of a CPPEditorDocument. CPPEditorDocument itself is quite small. * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor derive from BaseEditorDocumentProcessor and implement the gaps. * Since the semantic info calculation was bound to the widget, it also calculated the local uses, which depend on the cursor position. This calculation got moved into the extracted class UseSeletionsUpdater in the cppeditor plugin, which is run once the cursor position changes or the semantic info document is updated. * Some more logic got extracted: - SemanticInfoUpdater (logic was in CppEditorSupport) - SemanticHighlighter (logic was in CppEditorSupport) * The *Parser and *Processor classes can be easily accessed by the static function get(). * CppHighlightingSupport is gone since it turned out to be useless. * The editor dependency in CompletionAssistProviders is gone since we actually only need the file path now. Change-Id: I49d3a7bd138c5ed9620123e34480772535156508 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: change return type to enum.Erik Verbruggen2014-08-201-18/+18
|/ | | | | | | And not have it converted to int after converting to unsigned. Change-Id: If95caec46936c2a140c3fbd668fa2f085a9287ed Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* CppTools: Auto-include pre-compiled headersNikolai Kosjar2014-07-241-1/+3
| | | | | | | | | | | | So far the pre-compiled headers were processed (thus defines from those headers were visible), but the actual includes for the documents were not added, which is necessary for lookup/completion. Note that this will be only done if pre-compiled headers are not ignored (Options > C++ > Code Model > [] Ignore pre-compiled headers). Change-Id: I54a8e6b00597af164d958e3e9f2a1075ea187788 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix expensive parsing of expressionsNikolai Kosjar2014-07-241-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For expression statements like "(g(g(g(...(g(0))...))))" we reparsed quite much again and again for nothing. The high-level trace for this expression looks like this: parseCastExpression parseTypeId parseAbstractDeclarator parseAbstractCoreDeclarator parseParameterDeclarationClause (--> DEEP) ... parseUnaryExpression ... parseCorePostfixExpression parseTypeId (--> DEEP) parsePrimaryExpression (--> DEEP) Especially parseTypeId is expensive in this case and it's called two times, both from the same token (index). With this patch, we remember for certain ASTs the parse results and re-use them when needed. Change-Id: I013d1c064c655636bc94db408097863b5e183fc2 Task-number: QTCREATORBUG-12252 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Tests: Run ASTVisitor on parsed documentNikolai Kosjar2014-07-241-0/+8
| | | | | | | ...as a sanity check. Change-Id: I391276e41c5180d0df72fa6267f58801bf2d5da3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Support alignas in C++11 mode.Erik Verbruggen2014-07-223-6/+45
| | | | | | Change-Id: Ifa81a481bf92b5b71495a105ae292f3e9895f704 Task-number: QTCREATORBUG-9279 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: block recursion when parsing subsequent case statements.Erik Verbruggen2014-07-222-0/+100007
| | | | | | | | | | | | | | | | | | A case or a default statement must be followed by another statement. When a such a case (or default) statement is followed immediately by another case (or default) statement, then this would create a linked list, and the parser will recurse to parse such input. In order to prevent the parser running out of stack space while recursing, parse this corner case by blocking parsing a labeled statement as the first statement after a labeled statement. The advantage is that these statements do not form a linked list, so any subsequent visitation of the AST won't run out of stack space either. Change-Id: Id2111a49509132997f5fbe4bb12c92c729ec2522 Task-number: QTCREATORBUG-12673 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix return type of lambdaNikolai Kosjar2014-07-101-6/+107
| | | | | | | | | | | Relying on "_type" for the lambda was wrong. In case of the bug report the return type of the lambda happened to be the template class. Because of that Clone never stopped cloning. Change-Id: I377d12e6a8278198abd1488fbdbc89b4157c1357 Task-number: QTCREATORBUG-12631 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix preprocessor line offsetsNikolai Kosjar2014-07-041-0/+21
| | | | | | | | | | | In TranslationUnit, the "normal" lines are based on utf16char offsets, but the preprocessor lines were based on byte/latin1 offsets. The preprocessor lines are now based on utf16char offsets, too. Task-number: QTCREATORBUG-7356 Change-Id: I3c41d1dcee8e9e487210f36da806b0229d3f4cd0 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix "duplicate data type in declaration" for lambdasNikolai Kosjar2014-07-042-0/+7
| | | | | | | | The "_type" wasn't reset. Task-number: QTCREATORBUG-12521 Change-Id: I0d38cb38e270260065313d1235d42f2689385850 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Fix parsing designators vs lambdasNikolai Kosjar2014-06-242-1/+29
| | | | | | | | | | | | | The introduction of C99 designators led to parsing problems with lambdas that were passed in as a function arguments. Fixed by prefering to parse without designators first. This will be cleaner/clearer once the appropriate "LanguageFeatures" from the Project Parts will be passed in. Change-Id: Ia9cb7c4a4c9345e729cf2044e1e5411fe63e33ec Reviewed-by: Wang Hoi <wanghoi@126.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C: Parser: Support parsing of c99 designated initializersWang Hoi2014-06-177-0/+205
| | | | | | | | | | | | | | | | | | | | | | | | | In case: int a[6] = { [4] = 29, [2] = 15 }; struct point { int x, y; }; struct point p = { .y = 3, .x = 2 }; Grammar change when c99 language feature is enabled: old grammar: braced-init-list :: '{' initializer-list '}' new grammar: braced-init-list :: '{' designated-initializer-list '}' designated-initializer-list :: designated-initializer (',' designated-initializer )* designated-initializer :: designator* initializer-clause designator :: '.' identifier | '[' constant-expression ']' Task-number: QTCREATORBUG-1902 Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++11: Fix parsing of expressions like vector<int>{1}.Christian Kamm2014-06-161-0/+1
| | | | | | | | | The parser considers '{' an operator and thus thought "template-id {" couldn't possibly be valid. This patch adds '{' as an exception to the rule. Change-Id: I40730fcdc5cade48566b4c8b6fde390f455bbdba Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix 'using' in separate block of scopePrzemyslaw Gorszkowski2014-06-131-0/+45
| | | | | | Task-number: QTCREATORBUG-12357 Change-Id: I7397b0e66783d3249daa5a8ee422bfd5f5bc7bea Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge remote-tracking branch 'origin/3.1'Eike Ziller2014-06-131-0/+39
|\ | | | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/shared/qbs Change-Id: Iba59e41db72e2afdf594f1f7003215d7d8d1e6d3
| * C++: add test for anonymous with __attribute__Przemyslaw Gorszkowski2014-06-131-0/+1
| | | | | | | | | | | | | | Change-Id: I1938ed1bf45523ec62f35bc3324f6553c0dafe22 Sanity-Review: Qt Sanity Bot <qt_sanitybot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
| * C++: fix nested anonymous with __attribute__Przemyslaw Gorszkowski2014-06-061-0/+38
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-12345 Change-Id: Ib2316ebdc81393b38185b9cb659fb85b78753e7b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
| * C++: fix findusage for member of typedefed anonymous structPrzemyslaw Gorszkowski2014-04-041-0/+44
| | | | | | | | | | | | | | | | | | | | | | Task-number: QTCREATORBUG-11859 Task-number: QTCREATORBUG-11860 Change-Id: I7484b3b88daefbb3c76bb86a9b573e8291072872 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> (cherry picked from commit 5416557a0b9247e911180a7cce4a5ed3b0c0f351) Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* | C++: Tests: Fix unicode tests with MSVCNikolai Kosjar2014-06-0513-122/+140
| | | | | | | | | | Change-Id: I5575826558bf60982ecc964e4dd85a3f4e920197 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
* | C++11: Fix parsing of trailing-type-specifier.Christian Kamm2014-06-043-0/+6
| | | | | | | | | | | | | | In particular "auto foo() -> typename Foo<T>::X;" didn't parse. Change-Id: I7665c9b387e222e4107f053a529d502813ebf617 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | Tests: Fix compilation on WinChristian Stenger2014-05-261-0/+4
| | | | | | | | | | Change-Id: I19e418fb05462e80b97f4d821cfa72b0b880ea5b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++: Tests: Clean up tst_checksymbolsNikolai Kosjar2014-05-231-1813/+1515
| | | | | | | | | | Change-Id: I9859ebbb57c1bb5b1382c7980bedb737df61542a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Add utf16 indices to Macro and Document::MacroUseNikolai Kosjar2014-05-231-13/+17
| | | | | | | | | | | | | | | | | | In most cases we need to work with the utf16 indices. Only in cppfindreferences the byte interface is still needed since there we read in files and work on a QByteArray to save memory. Change-Id: I6ef6a93fc1875a8c9a305c075d51a9ca034c41bb Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Cpp{Tools,Editor}: Expect UTF-8 encoded literalsNikolai Kosjar2014-05-232-1/+102
| | | | | | | | | | Change-Id: I9843c4163aad3fa3f1bfa33060c76328fc2dc25a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>